Post Reply  Post Thread 
Redirect to Files or Directories
Author Message
vwdesigns
Administrator
*******


Posts: 124
Group: Administrators
Joined: Nov 2007
Status: Offline
Reputation: 0
Post: #1
Redirect to Files or Directories

You have just finished a major overhaul on your site, which unfortunately means you have renamed many pages that have already been indexed by search engines, and quite possibly linked to or book marked by users. You could use a redirect meta tag in the head of the old pages to bring users to the new ones, but some search engines may not follow the redirect and others frown upon it.

Enter this line in your .htaccess file:

Redirect permanent /oldfile.html http:// www. Your domain .com/filename.html

You can repeat that line for each file you need to redirect. Remember to include the directory name if the file is in a directory other than the root directory:

Redirect permanent /olddirectory/oldfile.html
http:// www. Your domain .com/newdirectory/newfile.html

If you have just renamed a directory you can use just the directory name:

Redirect permanent /olddirectory http:// www. Your domain .com/newdirectory

(Note: The above commands should each be on a single line, they may be wrapping here but make sure they are on a single line when you copy them into your file.)

This has the added advantage of preventing the increasing problem on the Internet, as people change their sites, of 'linkrot'. Now people who have linked to pages on your site will still have functioning links, even if the pages have changed location.


Neil Handford
Virtual Web Designs
04-12-07 02:18 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: