About Website Source / Network

 

Website Hosting Guides - Set Up 301 Redirects

Tutorials

The Technical Aspects of Setting Up 301 Redirects in the .htaccess

If you have created a new page and want to transfer the Page Rank of the old page to this new one, you must be in the lookout of some visitor or spider friendly method of doing it. Redirecting viewers from the old page to the new one is done best with the help of 301 Redirect. However, there are various other types of redirects that can serve the same purpose like 302, JavaScript, and Meta Refresh.

Why 301 Redirect?

If you are using a client-side meta-refresh or a JavaScript redirect, the search engine may mistakenly conclude that you are using doorway pages. This is because often the client-side redirects make use of doorway creators in order to feed one version of a page to the visitors and the other version to the search engine spider. In the case of a 302 Temporary Redirect, the Page Rank and other authority factors are not transferred to the new page. This is because the search engine assumes that after a certain period of time, the page will be returned to its original location. Therefore, “301” is the safest method to redirect old pages to new ones.

Javascript Redirect Example
 

When to Use 301 Redirects?

In most cases, the “301 Redirect” is used by site owners to transfer their site from “non-www” version of the URL of the site to “www” version. Suppose, your site name is xyz.com. You need to use the 301 Redirect method to redirect the site name to www.xyz.com. This process is a must as it not only prevents 302 hijacking, but also blends the link popularity of the two and restricts duplicate content filter.

This is certainly not the only case when you require using the 301 Redirect method. Multi domains were secured to increase link popularity of certain domains and gain more traffic. But, the content in each of the domains remained the same. Since search engines are extremely sensitive to duplicate content, all of the sites can be booted and banned. The way out is to redirect all the spare domains to a single main domain using the 301 Redirect. This process has made securing more and more domain names easier, some even with the misspelled version of the site. In this way, if someone types in the wrong spelling in the browser, he/she will be automatically redirected to the main page.

You may even want to move certain articles from an old site to a new one. In this case you need to use a 301 Redirect on a per page basis. The 301 redirect method is considered ethical and white hat. Now that you know that 301 Redirect is the acceptable and best way to redirect files, pages and even domains, you may be curious to know how it works. Implementing a 301 Redirect is really easy and fast.

Technical Requirements for 301 Redirect in .htaccess

You require an Apache server and the .htaccess file. Most of the hosting services that you use has Apache server. The .htaccess file is important as the web checks for it after receiving request from a search engine spider. They add the Redirect to your server’s root command. If done improperly, it may result your site to fail totally, making it unreachable to the users. The 301 is the safest way to Redirect files and also preserve Page Ranks. When the next spidering occurs, the search engine robot obeys the rule that you indicated in .htaccess file.  It is not that the search engine spiders actually read .htaccess files, but it identifies the response given by the server as valid. 

301 Redirect - Moved Permanently

How to Implement a 301 Redirect?

Redirecting pages become easier once you know the way to apply the .htaccess file. In order to use the .htaccess file, you need to open your FTP and login to the site. Search for the .htaccess file in the root web folder. In case there is no .htaccess file; you will have to create one. You can use a Notepad to create a .htaccess file. Make sure you insert a period before the file name and use no extensions. It should look like this – “.htaccess”

You need to create a code to make .htaccess work. Usually it reads like this:

Redirect Permanent / http://www.sitename.com/
Or
Redirect 301 / http://www.sitename.com/

Redirect Permanent or Redirect 301 tells the server to redirect the site permanently. The “/” indicates that everything in the site from top to bottom need to be redirected. In this process, all the present pages and links in the search engine results that are there for the old site, will be redirected to the top level of the current site.

In case you already have the .htaccess file on your server, check for the codes by opening it in any code editor or HTML editor like the TextPad. To redirect multiple domains to a single one, you need to first enter the URL of the unused domain, insert a space, and then type in the new domain URL. Make sure to save the .htaccess file in the root directory. Once it is saved, upload it on the server. To be sure that there has been no error in the codes, it is best to try it out by typing the URL of the old site. If you are redirected immediately to the new website address, you have successfully implemented 301 Redirect in .htaccess. If it shows error message in the page, you need to edit the .htaccess file again.

Multiple Domains and 301 Redirect

Redirecting Web Page in .htaccess

You may sometimes want to redirect a changed web page without altering the Page Rank of the old page. For this, you need to write a different code in the .htaccess file. It should be as follows:

 

Redirect 301 /old/old.htm http:/www.currentpath.com/new.htm

 

The original file name and path is represented by “/old/old.htm”. The file name and the new path are indicated by “http://www.currentpath.com/new.htm”. With this code, when the search engine visits your old web page, it will be automatically redirected to the new web page. 

How to Avoid Errors?

The search engine indexes not only the site, but also the Page Rank. Transferring files from one site to another may cause you to lose traffic. It leaves the visitors of your site with the message: “Error 404 – File Not Found”. You may create a custom error page to avoid this, but even in that case, the Page Rank will be will be lost as the file will appear as non-existent during the next search engine update. Moreover, the viewers may also feel reluctant to search through the site to find relevant information. To avoid such a thing from happening, you require using the 301 Redirect method since it is both visitor and spider friendly.

Error 404 - Page Not Found

In Brief - 301 Redirect in .htaccess

If you want to permanently relocate a page, file or domain to a new location, the 301 Redirect is the best method for it. Even though you can use a JavaScript redirect, a 302 Temporary Redirect or a client-side meta-refresh redirect for the purpose, they are not search engine friendly means. The above ways of redirection can not only hamper the Page Rank of your site, but can also have your site being banned by the duplicate content sensitive search engines. The 302 Redirect works on a temporary basis and the search engine does not transfer the authority factors and link popularity to the new location. This is because the search engines assume that the new page will be returned to its original location after some period of time as 302 Redirect works temporarily. Thus, when you want to permanently redirect new pages, files and domains to a new location, you require a method that will be search engine friendly and at the same time preserve your Page rank. This is when the 301 Redirect comes handy.

The three basic things needed for 301 Redirect in the .htaccess file are - an Apache server, the .htaccess file, and knowledge on how to use the file. The .htaccess file, also known to be the control file, permits changes in server configuration on a per-directory basis. The .htaccess file is located in the root web folder. To redirect your desired file or pages, you need to begin the code with the command “Redirect Permanent” or “Redirect 301”. In the .htaccess file, after placing the 301 Redirect command, you need to place the path of the old file, followed by the URL of the current location. By using 301 Redirect in the .htaccess file, you can transfer a file, page or the whole domain to a new location.

Among the various search engines, Google handles 301 Redirect best. Yahoo is yet to overcome some technical difficulties in this matter. Even though there are situations when the search engines lose 301 – related information, during major updates, but as far as redirection is concerned, the 301 Redirect method is the acceptable method by the search engines and so far the best one.

 


Note: All Content Copyright © Website Source, Inc.

Footer Image



Login


Website hosting customer feedback

Thank you for all your help. Your web hosting is above par!

Don

read more