If you don't know what a HTML/xHTML/DHTML 301 redirect is, you will by the end of this thread! If you need to redirect a page, unfortunately it isn't as simple as using one of the various methods - only the 301 redirect will preserve search engine rankings for the page. It is the most efficient, search engine friendly method for website redirection - the code 301 is interpreted as "moved permanently".
Here is how to perform a 301 redirect in the 3 afformentioned coding languages:
HTML, xHTML, DHTML:
- Create a .htaccess file by opening up notepad, or a similair text/txt editor and save the file as .htaccess with no extension.
- Place this code in your .htaccess file:
Code:
redirect 301 /old/old.htm http://www.yoursite.com/new.htm
OR, if you are redirecting to a new url, you need the following code:
Code:
redirect 301 / http://www.yoursite.com/new.htm
If you already have one of these files - make sure you leave a line before adding the code!
- Save the file and upload to your server root folder.
Test the redirect works by visiting the old page - you should automatically be redirected!