301 Redirects | Perficient Digital

301 Redirects

301 redirects play a major role in search engine optimization. They enter into the equation in many different situations, but the 2 most common situations are:

  1. All sites should redirect all URLs associated with their domain which do not start with “www” (i.e. “http://yourdomain.com”) to the same pages on your their domain that start with “www” (i.e. “http://www.yourdomain.com”). This is referred to as a canonical redirect. The reason this is important is that search engines are not smart enough to tell if the non-www version of your domain is really a different site, or not, then the www version of your domain. And, if other people link to your site, you can’t control whether or not they link to your site with a www or not.
  2. You decide to move the content on one or more pages of your site to a new URL. Sometimes you may do this simply because you are improving the site architecture, or you may do it because you are moving to a new domain.

In either of these situations, you should use a 301 redirect. Other redirects are dangerous to use. Both the 302 redirect and the meta-refresh technique for performing redirects are potentially harmful to your site’s ranking in the search engines. The 301 redirect is seen as a “permanent move” of the content, and the links to the page, to a new location and the search engine acts accordingly. The 302 redirect and meta refresh are seen as “temporary moves” of the content.

Specifically, when a search engine sees a temporary redirect, the search engine continues to assume that the redirecting URL is the owner of the content. This means that all link credit associated with the redirecting page is associated with the redirecting page and not the new page. In addition, you may get flagged as being a potential spammer, because in the past, spammers used temporary redirects to other people’s sites as a way of stealing traffic from them.

When a search engine sees a permanent (301) redirect, it assumes that all credit for links to the redirecting page actually belongs to the new page. This helps search engines transition to indexing the new page very quickly, and does not bear the potential stigma of association with past spammer tactics.

So now that you know that you need to do a 301 redirect when you move content, or to move non-www URLs to www URLs, what is the proper technique? It depends on your OS. Here is how it breaks down:

  • Unix and Linux users should use .htaccess files. This is a simple server level technique for handling redirects. You can use “mod rewrite” rules as a powerful method for redirecting many URLs from one location to another. Click here to learn more about mod rewrite. For example, you can redirect all non-www traffic to all www URLs, with the following Mod Rewrite script:RewriteEngine on
    RewriteCond %{HTTP_HOST} yourdomain\.com [NC]
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
    RewriteRule ^(.*) http://www.yourdomain\.com/$1 [L,R=301]
  • Windows users should use IIS Redirects if at all possible. This is also a server level redirect that is transparent to search engine crawlers. The procedure you should follow is:
    • Go to Internet Services Manager and right click on the file or folder you wish to redirect
    • Click on the radio button titled “A redirection to a URL”
    • Click on the checkboxes titled “the exact URL entered above” and “a permanent redirection for this resource”
    • Click on “apply”

    If you do not have access to your server, or if your host will not take care of this for you, you need to relay on a PHP script (requires that your old page and your new page both be coded in PHP). Here is some sample code for PHP:

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

Use 301 redirects whenever you are moving content on a permanent basis, in order to preserve your search engine rankings to the best degree possible. For most webmasters, 302 redirects and meta-refreshes should never be used.

One exception to this is if you are unable to set up a 301 redirect (perhaps you can’t get access to your .htaccess file because it’s on a shared server), you can use a meta refresh set to 0. It appears that search engines are now treating this the same as a 301. But make sure its set to 0. Here is the proper code:

<meta http-equiv="refresh" content="0">

Note that search engines behave differently when processing search engine redirects. All of them will handle the physical redirection of traffic as expected. What becomes more complicated is when you have a page below your home page that has direct external incoming links. If you make drastic changes, such as moving to a new domain, or renaming all the URLs on your site, make sure you redirect all pages from the old URLs to the equivalent new URL. For example, redirect:

http://www.yourolddomain.com/article-317

to

http://www.yournewdomain.com/article-317

The search engines normally handle complex redirect situations such as this very efficiently and will update their index very smoothly and quickly, and pass on all link credit from the old page to the new page. While this does happen correctly the great majority of the time, there are horror stories out there about errors in the process, and our own experience has not always shown perfect results.

For that reason, you should only move URLs, or domains, when you really need to. It’s important to not rely on these techniques unless you have to. But if you do, the 301 redirect is the tool of choice.

Contact Us

Uncertain about which services will best address your business challenge? Let our digital marketing experts help.

CONTACT US

2 responses to “301 Redirects”

  1. Matthew says:

    Hi Eric, I’ve been following you and Mark on YouTube and I really like your “Here’s Why” series. Actually, that made me search on Google to find if you have any good resource for redirecting a domain.
    I’m trying to do this by myself, and redirect my existing domain to a brand new. but I’m not sure how to do it properly.
    I was reading this post:https://support.google.com/webmasters/answer/6033085?hl=en&ref_topic=6033084
    And I stumbled on several different articles as well (BruceClay, Moz), like do it via, html or php or htaccess.
    The problem is I don’t know what to do with the existing content, media library. etc.
    According to Google best practices, I need to transfer the content manually, but on the other hand, other SEOs are just saying to do a redirect from the get-go?
    I’m using WP, Cpanel, and SiteGround, and I have around 20 articles if that makes any difference.
    I would appreciate any help.
    Thanks in advance,
    Matt

  2. Eric Enge says:

    Sorry for the slow response. Flu floating around the office! If you’re changing the domain for your site, you need to redirect all pages, one by one to the new domain. However, if you’re not changing the URL structure of the site during the transfer to the new domain, this can be done with three lines of code in your .htaccess file. If you are changing the URL structure, youo then have to redirect the URLs one at a time, from the old URL on the old domain to the new URL on the new domain.

Leave a Reply