Reach out to us!

arrow
article icon

HTTP Status Code 301: Redirects and SEO


HTTP status code 301 is a tool for permanently redirecting web crawlers and site visitors to an address that differs from the initial one. This permanent redirect means that the old URL is no longer relevant, and the page has moved. After reindexing, search engines will offer visitors a new address. Let’s find out how to do 301 redirect the best way.

What is HTTP Status Code 301 Used for?

An HTTP 301 response is an efficient, easy-to-implement web page redirect. This is a handy way to save the ranking of a particular page on your site.

Here are the main reasons to use a 301 redirect:

  • Preservation of accumulated user signals of content;
  • Transfer of link value to a new page;
  • Redirecting traffic from other addresses to the desired one;
  • Client base retention in case of rebranding and domain change;
  • Moving of pages;
  • Removal of duplicate pages.

What is a redirect? In a way, it’s like a lifesaver. In the case of moving your entire site or individual pages, a 301 permanent redirect will retain all your labor’s fruits: domain name authority and SERP position. Another question might be, Do redirects hurt SEO? The main thing is to use an HTTP status code 301 as intended. You should always opt for an address preferred by visitors and search engines, as it is strategically more important.

Redirection Tips

Poorly set up redirection can have a much lower output, sometimes even harming your site. Make sure to check everything for possible errors. Here are a few basic tips on how to set up a 301 redirect.

  • Avoid redirections that follow each other. Each subsequent redirection increases the load on the server and reduces the overall efficiency.
  • Shift redirection rules from particular to general rules since conflicts between both may cause them to fail. If the particular rules are lower than the general ones, the latter will take priority in case of a conflict, as they come first on the list.
  • Due to the fact that browsers usually remember redirections, it’s better to check the HTTP status code 301 via dedicated services.
  • Make sure the redirection is not cyclical, as a page cannot refer to itself.
  • A useful redirection leads to a page repeating all the nuances of the requested one.

Popular Types of Redirects

Let’s take a look at the most popular redirect types. It’s worth noting that you don’t have to use a permanent redirect code all the time. It’s a redundant action if your moving is short-term. And it’s definitely not recommended if you want to get rid of old domain problems. If you get banned and filtered, you move all these problems to the new address.

HTTP status code 301

This permanent redirect code implies that an old address is obsolete and all content is moved to a new place. The 301 redirect preserves almost all link juice and combines all stockpiled inner metrics for the new address.

HTTP Status Code 302

This is a temporary redirection, meaning that subsequent requests should use an old URI. It doesn’t combine all stockpiled inner metrics. The response status name depends on the HTTP version:

  • HTTP 1.0 – Moved Temporarily
  • HTTP 1.1 – Found

HTTP Status Code 307

An HTTP 307 is applicable for sporadic cases, such as short-term content moving due to maintenance.

Meta Refresh

Meta refresh is a redirection done by a page rather than by a server. Oftentimes, such redirection is indicated by a several-second timer and a message like “if you haven’t been redirected, click here.”

This option is fairly slow and is not recommended in terms of SEO. It can negatively impact behavioral factors and drop in ranking.

Temporary vs. Permanent Redirect

An HTTP 301 response and an HTTP 302 seem very similar. Nevertheless, a permanent 301 redirect is a better solution for most cases.

Web crawlers do not perceive these HTTP codes equally, thus impacting SERP ranking differently. What is 301 redirect in SEO? An HTTP status code 301 is a sign for the web crawler to forget an old address and stop visiting it. An HTTP 302, in turn, signals that the search engine should continue indexing content on the initial address.

In the case of a 301 permanent redirect, obsolete content won’t be displayed on SERP. With an HTTP 302, SERP will offer both pages.

Temporary redirection is useful for rare cases such as:

  • an old page contains links that have to be kept indexed
  • indexing of a new page is not crucial

A 301 Redirect Code vs. Canonical

Despite some nuances, search engines have set clear rules for command usage. Here’s how Google & Co perceive them:

  • A 301 redirect – “My page has permanently moved to a new place, it’s not gonna return. Please delete it from your indexing and authorize the new address.”
  • Canonical – “I have several versions of my page. Please consider a version that I’ve marked as canonical. Let the other versions be available for visiting, but don’t index them.”

In Which Scenario is Using a 301 Redirect Useful? 

  • it’s the best option by default;
  • HTTP 404 and old content that still has valuable links and solid traffic;
  • domain change after rebranding or resource sale;
  • permanently moved page.

Use Cases of rel=”canonical”

  • if an article has duplicates that visitors need, e.g., descriptions;
  • same product but different colors;
  • when a permanent redirect is challenging to implement;
  • cross-domains with similar articles;
  • different addresses with the same content (catalog sorting).

How to Set Up a 301 Redirect?

How to do a 301 redirect? A permanent redirect can be set up in different ways, depending on the engine.

.htaccess, or httpd.conf for Apache

This is a popular method due to its simplicity. You need to create a file called .htaccess in the site folder or edit it if the engine already provides it. Before making any changes, make a Backup of the edited file (or the entire site). For a 301 redirect Apache, write the following code using your data:

Redirect All Pages to the New Domain:

Redirect: http://old-site.com/ -> http://new-site.com/

Redirect from One Page to Another:

Redirect: http://domain.com/page-1/ -> http://domain.com/page-2/

Redirect from www to non-www:

.www version is a subdomain. And while a subdomain is part of the main website, it’s considered a separate entity by search engines.

To configure the main mirror, add the following lines to the .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

Redirect from HTTP to HTTPS:

HTTPS protocol has been a well-known ranking factor since 2014. You should add the following code to redirect the old website to the new website with a more secure protocol:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Please note that the commands mentioned above are done at the server level with ОС Linux or Apache with an activated Mod_rewrite module. As an option, you can change the .htaccess 301 redirect with the httpd.conf configuration file. In this case, you lower the load on the server, but web admins usually do not have access to it.

Implementing 301 Redirects on WordPress

How to do a 301 redirect in WordPress? A 301 redirect to a new domain can be easily set up using a dedicated plugin. For example, the Simple 301 Redirects by BetterLinks plugin for WordPress sites. Its only drawback is that the redirected address list has to be manually input. Each WordPress plugin has its own algorithm, but overall they all are intuitive. The same goes for Shopify and the rest of CMS top dogs.

Nevertheless, creating a 301 permanent redirect in a CMS is rather a last resort. You should opt for doing it at the web server level since it’s much faster, and managing redirects at two places at once can trigger conflicts. Managing redirects is already a complicated process, don’t make it even harder.

Redirects by Issue Type

Does domain forwarding affect SEO? To get better SERP positions, you should get rid of copies first.

Mass Merging of index.php, index.html, index.htm, index.asp

This mass merging is especially relevant for SEO purposes. You might want to use mass merging to avoid page duplicates and any interference with the ranking of the main pages.

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.(php|html|htm) HTTP/
RewriteRule ^(.*)index.(php|html|htm)$ http://site.com/$1 [R=301,L]

Merging Duplicates with a Slash

Use the following code to remove a slash through your site:

RewriteCond %{REQUEST_URI} !?
RewriteCond %{REQUEST_URI} !&
RewriteCond %{REQUEST_URI} !=
RewriteCond %{REQUEST_URI} !.
RewriteCond %{REQUEST_URI} ![^/]$
RewriteRule ^(.*)/$ /$1 [R=301,L]

To make a redirect from pages w/o a slash to ones w/ a slash, add the following:

RewriteCond %{REQUEST_URI} !?
RewriteCond %{REQUEST_URI} !&
RewriteCond %{REQUEST_URI} !=
RewriteCond %{REQUEST_URI} !.
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*[^/])$ /$1/ [R=301,L]

How to Remove Multiple Slashes or Dashes in the URL?

In the case of extra slashes in a URL, you should redirect to a page with one slash:

www.site.com/catalog/page-1.html:
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]

To merge multiple dashes, write the following after www.site.com/catalog/page-1.html:

RewriteCond %{REQUEST_URI} ^(.*)—(.*)$
RewriteRule . %1-%2 [R=301,L]

To a Lowercase URL 

Experienced developers know that search engines distinguish different case letters, so they try to add all addresses in lowercase from the get-go. Want to know how to create a 301 redirect to a lowercase URL? Write the following code at the PHP script level:

$lowerURI=strtolower($_SERVER['REQUEST_URI']);
if($_SERVER['REQUEST_URI']!=$lowerURI)
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://" . $_SERVER['HTTP_HOST'] . $lowerURI);
exit();
}

How to Check 301 Redirect?

There are several ways to check the introduced changes properly:

  • go to the homepage/another target page and look at the URL bar to check if the changes applied;
  • step by step by manually using services like Header Checker Tool or this one;
  • extensions/addons that are specific for each browser, like this Chrome extension;
  • batch-checking by using software like Screaming Frog Seo Spider that scans the whole site.

Keep in mind that search engines need some time to spot an HTTP status code 301 and authorize a new address. How long it takes for 301 redirect to take effect depends on how often web crawlers visit the site. It may take up to 2-3 weeks.

Most Common Redirect Errors

  • using internal redirects without changing the URL in the links;
  • implementing a multi-step redirect;
  • setting temporary redirects instead of permanent ones; 
  • incorrectly chosen redirect type;
  • redirecting the robots.txt file;
  • misunderstanding the difference between rel=canonical and 301 code;
  • redirecting to irrelevant content.

Now you know all the types of redirects and how to set up a 301 redirect. Do it right, do it the easy way, and avoid the mistakes mentioned above. Good luck!


Need an SEO Consultation? Book a call with our SEO Expert. 👉 SCHEDULE A CALL

0 0 votes
Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments