How to Implement a 301 Redirect the Right Way

Implementing 301 Redirect



Don’t Lose Your Link Juice, implement a 301 Domain Redirection.

If you are switching domains, or are redesigning your website, which is causing your page structure to change, you need to consider all of the impacts of what these changes will mean to your page rank and domain authority. The short answer is that any time your URLs change, either through a domain name or page name change the search crawlers will not know how to find your site, and you will have to start building your PageRank and domain authority from scratch.

A very helpful seo technique is to create a 301 redirect so that the search engines know that your old site or pages know have a new location and they can pass all of your SEO rankings to your new URLs. We will be talking about the different types of redirects, when to implement them and how to implement them at the server or link level.

Why Implement a Redirect

  1. You have moved your site to a brand new domain and you want to make the transition as seamless as possible.
  2. To standardize the URL that all traffic will arrive to at your site. For example, if multiple users access your site via different URLs (example.com/home, home.example.com or www.example.com), your SEO rankings are being diluted by all three of these URLs because you are spreading out the value of all inbound links to your site. It is therefore a good SEO technique to choose one of these URLs as your favorite and then redirect all other incoming traffic to your chosen URL. The SEO name for this technique is Canonicalization. This standardization can be done via a rel=”canonical” link, a 301 redirect, or through Google’s Webmaster tools.
  3. Redesigning a website, and you want to make sure that the old pages are redirected, indexed and maintain the page rank of the original website.

The Canonicalization Conundrum

In computer science, canonicalization (sometimes standardization or normalization) is a process for converting data that has more than one possible representation into a “standard”, “normal”, or canonical form.

Using rel=”canonical”

Having multiple URLs spreads out the value of inbound links to the home page, therefore affecting pagerank. The major search engines are giving all of these multiple URLs credit independently and not as a whole. An alternative to 301 redirects to acheive canonicalization, is to use the rel=canonical tag. The rel=canonical tag passes the same amount of ranking power as a 301 redirect and is easier to implement. The rel=canonical is added to the head section using the following standard:

This tells the search engines that the page should be treated as if it were a copy of that URL, and that all of the links and content metrics should be credited towards the provided URL.

Types of Redirects

  • 301, “Moved Permanently”—recommended for SEO
  • 302, “Found” or “Moved Temporarily” (not recommended unless the move is for a short period of time.)
  • Meta Refresh

301 redirect

A 301 redirect stands for the HTTP status code stating that a page has permanently moved to a new location. Using a 301 redirect is the preferred SEO URL redirection method. a 301 redirect helps you maintain your PageRank, since it passes between 90-90% of the link juice (ranking power) to the redirected page. A 301 redirect is the

Google’s Matt Cutts explaining 301 redirects




“If you need to change the URL of a page as it is shown in search engine results, we recommend that you use a server-side 301 redirect. This is the best way to ensure that users and search engines are directed to the correct page. The 301 status code means that a page has permanently moved to a new location.” – Matt Cutts

302 Redirect

A 302 redirect is an HTTP status code stating a temporary redirect. There are very few instances where this type of redirect should be used, but unfortunately it is the easiest to implement. This means that many webmasters unfamiliar with search engine mechanics use the wrong type of redirect.

Meta Refresh

Meta refreshes are a type of redirect executed on the page level rather than the server level. They are usually slower, and they are not a recommended SEO technique. Meta refreshes do pass some link juice, but are not recommended as an SEO tactic due to poor usability and the loss PageRank passed.

Implementing Redirects On Different Web Servers

IIS 301 Redirects

The service role of common HTTP features need to have been added and HTTP redirection have been selected. HTTP redirection needs to have been added

In IIS Manager in the home page select HTTP redirect. In the HTTP redirect pane check the box to redirect rquests and enter the destination URL, then configure the HTTP status code to show either 301 permanent, 302 temporary redirect , or 307 permanent redirect. It is best to use 302 unless the redirect is going to be temporary.

Visit IIS.net for more detailed info on IIS redirection:

Apache 301 Redirects

An Apache web server can implement 301 redirects through script code modifications to one of two of its text-based configuration files: either .htaccess (for directories representing separate sites on one server) or httpd.conf (at the root of the Apache installation). Typically the .htaccess configuration method is used, so we’ll focus on that here.

Remember to set these on the source site (the old site).

  1. Backup your .htaccess file, found in the root of your web server.
  2. Open the .htaccess file using a tex editor.
  3. enable the Apache mod_rewrite module.
  4. enable the ReWriteEngine in the mod_rewrite module using the following code:

Redirecting a page url to another page url

Add as many of these as you need in the .htaccess file.

5b. Redirecting a directory and all of its contents to another directory

5c. Redirecting a domain name URL to another domain name URL

5d. Redirecting for canonicalization (making sure all traffic is going to example.com). This is an SEO best practice, since you want all of the link juice and pagerank to go to one specific URL and not several within your site.

Redirecting everything to WWW

redirecting WWW no non-WWW

Nginx 301 Redirects

Create a rewrite rule

restart nginx

For a permanent redirect change “redirect” to “permanent” at the end of the statement.

Reference

How to Create Temporary and Permanent Redirects with Apache and Nginx

Why Canonicalization Matters From a Linking Perspective

HTTP Response Codes