What is a 301 redirect?
A 301 redirect refers to the HTTP status code 301 which indicates that content has permanently moved from
URL A to
URL B. Because of the permanent nature of the 301 redirect, authority and relevance of
URL A carries over to
When you need to redirect URLs, in most cases you’ll want to use a 301 redirect. Because it carries over authority and relevance to another URL, it is an essential tool in every SEO expert’s toolbox.
Why should you use 301 redirects?
When your content moves, you want to make sure it affects your SEO performance as little as possible. That’s where the 301 redirect comes in.
If you don’t implement 301 redirects when content moves, both visitors and search engines will have a hard time figuring out where the content moved to. VIsitors will hit a 404 page, and search engines will not be able to attribute any built up relevance and authority to the new URL. This results in your rankings dramatically dropping.
How does a 301 redirect work?
We’ll explain how 301 redirects work with a simplified example of a client that request an redirected URL:
Step 1: Request
A client requests a URL from a server:
Step 2: Server response
The server looks up the URL and finds it’s been permanently moved, which it replies to the client:
Step 3: New request
The client requests the URL the content has been moved to:
Step 4: Server response
The server sends back that everything is OK, and sends the URL’s assets along as the payload:
When would you use 301 redirect?
You implement 301 redirects to make sure visitors and search engines that visit an old URL are redirected to its new URL.
In SEO, there are many situations in which you’ll need to do this. Here are some common examples:
- You’ve changed a page’s URL (see the example above).
- You’ve changed a subfolder’s URL (e.g.
- You’ve moved a subdomain to a subfolder (e.g.
- You’ve changed domain names.
- You’ve switched from
You get the idea: any time content has moved you want to make sure both visitors and search engines don’t end up on 404 pages. That’s where redirects come in.
What happens to a page that’s 301 redirected?
While a redirected page can still exist within a Content Management System, it won’t be available anymore to visitors and search engines.
Search engines will consolidate the old URL with the new URL, and stop showing the old URL in their search results. The time search engines need to stop showing the old URL completely varies, in practice we see this can take anywhere from a few days to a few months.
How do I create a 301 redirect?
In this section we’ll discuss creating 301 redirects on Apache, nginx and WordPress.
How do you create a 301 redirect on Apache?
On Apache webserver, redirect rules are kept in the
Here’s a simple example of implementing a 301 redirect on Apache to redirect
How do you create a 301 redirect on nginx?
On nginx, redirects are kept in your
Here’s how to implement that same 301 redirect from the Apache example, on nginx:
How do you create a 301 redirect in WordPress?
The easiest way to create 301 redirects in WordPress is through a plugin.
There are plenty of plugins available, with the most popular one being Redirection with over a million installs. Let’s use that plugin to redirect
Hit the blue
Add Redirect button and you’re done.
Can you change a 301 redirect?
Yes, by adjusting the server configuration files as described above, or by adjusting redirects that are configured through a plugin you can adjust them at will.
Be careful when changing 301 redirects though; it’s easy to make mistakes that result in redirect loops or URLs that stop redirecting all of a sudden. Test any adjustments you’ve made carefully.
Redirects may be holding back your SEO performance.
Check your website for excessive redirects right away!
Can you have too many 301 redirects?
If we’re talking about the amount of redirects that are implemented for a website, then the answer is “no” in 99,99% of the cases.
If we’re talking about chained redirects, such as for example when
URL A redirects to
URL B, which in turn redirects to
URL C and so on, then “yes”. Chained redirects are bad from both an SEO point of view and a visitor point of view, because crawlers and browsers will stop following the redirects.
How long for 301 redirects to take effect?
That depends on your website’s crawl budget (how much attention search engines can give your website).
It’s common to see that redirects implemented on authoritative sites are picked up faster than on smaller, less authoritative sites.
As a rule of thumb, count on a few days up to a few weeks.
Are there situations in which not to implement 301 redirects?
Yes, for example when content hasn’t been moved permanently. In that case, you need to use a 302 redirect.
When you use a 302 redirect, both URLs remain indexed and browsers will not cache the redirect.
How do 301 redirect affect browser behavior?
Browsers aggresively cache 301 redirects. When you remove a 301 redirect, and you request the URL that was previously 301 redirected, it can look like the redirect is still in place, while in reality it’s your browser that’s cached the redirect.
In order to fix this, you need to purge the browser’s cache (a æhard refresh” using
CMD + R or
CTRL + F5 isn’t enough).