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:
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:
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!