.htaccess tutorial

htaccess Elite


From Old to New (extern)

Ask your mod_rewrite and Redirection questions here, and get answers!

From Old to New (extern)

Postby produke » 30 Oct 2006 20:44

Assume again that we have recently renamed the page foo.html to bar.html and now want to provide the old URL for backward compatibility. But this time we want that the users of the old URL get hinted to the new one, i.e. their browsers Location field should change, too.

Solution:
We force a HTTP redirect to the new URL which leads to a change of the browsers and thus the users view:

Code: Select all
RewriteEngine  on
RewriteBase    /~quux/
RewriteRule    ^foo\.html$  bar.html  [R]
User avatar
produke
 
Posts: 242
Joined: 25 Sep 2006 04:48

Return to Redirect or Rewrite Questions



cron