Permanently renaming a file or directory

From DreamHost
Jump to: navigation, search

If you would like to rename your files or directories, but are worried about search engines or favorites that are linked to your old files or directories, add the following example to the .htaccess file. Just replace the filename and extension with your own.

 Redirect permanent /filename.html http://www.example.com/filename.php

The above will redirect a link from filename.html to the new filename.php. I believe it is required to have the entire http: protocol for the new file. Silkrooster 20:58, 11 Feb 2006 (PST)