Depiction- Webmaster Resources
Stock Image


Contributors: Advertise Here  |  Advertise Here  |  Advertise Here


Misc Links: Submit Tutorials (Earn $$) l Advertising l Privacy Policy | Site Map

Tutorials > .htaccess > Redirection

 

Automatically redirect visitors to a page's new location.


Have you changed the navigation structure of your website by moving or deleting pages of your site? If a visitor has the old page bookmarked or comes from a link on another site to it, they will receive a 404 error; page can not be found. Solve this by redirecting the visitor to the new page. The method below will save you time; you will not have to create a seperate page letting the visitor know where the page has moved.


In your .htaccess file, add the following to the next available line. If you don't have one, a .htaccess file will need to be created. (Please refer to the Introduction to .htaccess files tutorial to find out how to use and create .htaccess files.)


Redirect /olddirectory/oldfile.html http://site.com/newdirectory/newfile.html

All you have to do to the code above is change the old and new file paths.


That's it. From now on when a visitor tries to access a file that has been moved, they will be redirected to the new one.


 
 

Affiliates

Tutorial Kit Photoshop Tutorials
Tutorial Man Wallpaper Stock  More

Resources