Creating 301 Permanent Redirect

August 16th, 2009

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page (including Google PR). If you have to change file names or move pages around, it’s the safest option. The code “301” is interpreted as “moved permanently”.

1. Login to cPanel and click the Redirects icon.
2. Leave the setting as 301 redirect, as this is preferred by search engines.
3. Select the appropriate domain name from the drop-down.
4. In the subsequent blank, enter an optional path and file name; this exact name must be typed to trigger the redirect.
5. In the large blank, enter the full URL for the redirect target; include http:// or https:// (e.g. http://speedhost.in)
6. Leave the other settings as they are, unless you know why you want to change them.
7. Click the Add button and you are done.

The above would make an entry directly to your .htaccess file. If you would like to do a 301 redirect in the .php file itself, then you can use the below code to accomplish the same.

<?
Header( "HTTP/1.1 301 Moved Permanently" ); 
Header( "Location: http://www.new-url.com" ); 
?>

Comments

  1. How to Redirect a folder to a Subdomain using .htaccess February 7th, 2010

    […] issue we can simply add or edit the .htaccess. This will tell SE’s that the folder has been permanently redirected to the sub […]

  2. Difference between 301 Permanent and 302 Temporary Redirect February 12th, 2010

    […] Permanent 301 They are permanent redirects from an old URL to a new one. These redirects tell the search engines that the old location is to be removed from their index and replaced with the new location. Using 301 redirects is the most search engine friendly way to redirect traffic and engines, and far out weighs that of various JavaScript and Meta refresh redirects. […]

  3. anusha March 9th, 2010

    i want to create .htacess file. How to create this file because this site developed in ruby and rails. Also i have one doubt,if i have only one server with same coding for multiple domain then how to write redirect coding for all domains.

Leave A Comment