Navigate
Sponsors
|
Redirecting PagesIntroduction::This guide shows you how to use .htaccess to redirect a specific page to another address. This is probably the best way to redirect pages mainly because of the lack of effort it needs to set up and it's not browser dependent like some redirection scripts. If you have to reorganise a web site or move pages or change page extensions like I have done recently (Dec 02) then this is a life-saver! RedirectingSimply place the following in your .htaccess file: Redirect /a-directory/oldpage.htm http://domain.com/b-directory/newpage.htm The command is always the same and comprises three important parts, the word Redirect, the directory/file you want to redirect relative to the root and the full URL of the file you want to redirect to. These three 'blocks' must be on one line and each separated by a single space. You can use this to redirect entire directories: Redirect /directory http://domain.com/folder/ ...or if you have simply changed file extensions: Redirect /directory/codes.htm http://domain.com/directory/codes.shtml Very simple but extremely useful! |