Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect to Files or Directories
#1
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.
Support
Webnetics UK Ltd.
Reply


Messages In This Thread
Redirect to Files or Directories - by webnetics - 04-12-07, 02:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)