Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite

on localhost, it doesn't rewrite in the URLbar

         

tomda

8:03 am on Feb 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just to know, does the mod_rewrite works on localhost.

If yes, is there a way to check the rewrited URL as it does not change in the URL bar and echo PHP_self is still giving me the non rewrited URL. I just want to have the rewrited URL as an output (PHP script or in the URL bar)

Tommy

jdMorgan

3:42 pm on Feb 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tommy,

From this recent thread [webmasterworld.com]:


If you intend to do an external redirect, where the new URL is visible to visitors and search engines, then you should use a canonical URL for the substitution, and set the [R] flag to do a 301-Moved Permanently redirect:

RewriteCond %{QUERY_STRING} ^(this¦that)=([0-9]{3})$
RewriteRule ^5\.shtml$ http://www.example.com/5.shtml?%1=0%2 [R=301,L]


The RewriteRule shows the form needed to update the browser address bar. It includes a full URL and the [R] flag.

Jim