Resources

  • 5 Questions You Must Answer
  • Statistics phobia and fear of failure are two things that will divert your focus.Don't waste a lot of time on things that are no so important especially in the beginning

Subscribe

  • Subscribe

301 Permanent Redirect Tutorial(.htaccess)

Posted by admin | December 21, 2008 .

301-redirect is the best way to tell search engines that you have permanently changed your site’s domain name or URL of the particular page.

You will create 301 redirects if you want to:

  • Change the domain name of your site
  • Change format of your site(from asp/html to php or vise versa)
  • Redirect from one page/file to another page/file of your site
  • Redirect from one page/file from one site to another page/file on another site

How To Create .htaccess file?

Recently I have created 301 and changed the domain name of this blog from moms-andpassionate-peoplewebsites.com to internetworld.me. Dot htaccess is a small file that works with apache servers and provides most simple and easy way to create 301 redirects.

If you don’t have .htaccess file on the root of your web host then you need to create a new one:

1) Open notepad and save the file as .htaccess(dot htaccess)

2) Upload this file to the root directory of your host.

How To Change The Domain Name OF Your site:

Upload all files of you site to the server where you’ve hosted your new domain and place the below code in the .htaccess file of your old site.

RewriteEngine On

RewriteRule ^(.*)$ http://www.Your-new-domain.com/$1 [R=301,L]

It is highly recommended that you should contact webmasters and correct your incoming links to the new domain.

Redirecting From One Extension To Another( ASP to PHP or vise versa)

If you want change the format of your existing site or you’ve developed a new site with new format then you will use the below code in the .htaccess file of site from where you want to create redirects.

RewriteEngine on

RewriteRule ^(.*)\.asp$ http://your-domain-name.com/$1.php [R=301]

This code will redirect all ASP pages to PHP

Redirecting From One Page To Another

If you want to redirect one page of your site to another page or one page from one site to another page on another site then you will use the below code.

Redirect 301 /any-page.html http://www.URL-of-the-landing-page.com

This will tell search engines that the particular page is redirected to the new URL

Technorati Tags: , ,

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

2 Comments so far
  1. [...] you can increase the Page Rank of your existing site just by 301ing your new domain but this method is not recommended and has many [...]

  2. Sergey June 5, 2009 9:01 pm

    Hi,

    Thanks for useful information. It helps me redirect pages from one site to another.
    Your explanation is very clear and short. It is not common.