Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Silent redirection not working with mod_rewrite I'm trying to grasp apache mod_rewrite When I add this to my .htaccess it silently (url doesnt change) shows page bob.htm RewriteEngine on RewriteRule

@Samaraweera270

Posted in: #Htaccess #ModRewrite

I'm trying to grasp apache mod_rewrite

When I add this to my .htaccess it silently (url doesnt change) shows page bob.htm

RewriteEngine on
RewriteRule index.htm bob.htm


I.e. If I type this in the browser address: mydomain/test/index.htm, I get the content for page: mydomain/test/bob.htm
However if I change the .htaccess to use the full path ...

RewriteEngine on
RewriteRule index.htm mydomain/test/bob.htm

It redirects, but not silently. Can someone explain what's going on please.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kaufman445

When using relative paths Apache performs an internal rewrite (eg. index.htm becomes bob.htm). When using complete paths Apache performs an external redirect (eg. the url changes).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme