You might have heard the term “301” before and wondered what it meant, or perhaps you know you need to redirect some pages on your site but are unsure of how to proceed, or how it might affect your SEO.
If so, this short guide should help you. In it we’ll discuss exactly what a 301 redirect is, how to implement it, and what SEO considerations to keep in mind.
Let’s go!
What is a 301 Redirect
A 301 Redirect is when one URL is permanently moved to another URL.
The number “301” is a Server Response Code. It’s how a web server responds to a request to load a webpage/URL. There are many other types of response codes (you may have heard of “404 page”, where 404 is the response code for “Error, Not Found”).
How to implement 301 Redirects
This is a common question that comes up, and it’s surprisingly has several different answers.s
Htaccess
The most common technical solution to the modify your .htaccess file. However, you should only do this if you know what you are doing and have FTP or SSH access to your site (because on wrong character in the .htaccess file could cause your entire site to stop working).
Every directory on your server can have it’s own .htaccess file, which is processed anytime a file is accessed in that directory. We can use .htaccess to tell a server our to grant access (blocking spiders or certain IPs), how to rewrite/redirect URLs (such as forcing WWW or non-WWW, or HTTPS or non-HTTPS), and what response codes to use when redirecting pages.
A simple 301 would look like this:
RewriteEngine on Redirect 301 / http://www.example.com/ This would redirect an entire domain to example.com. Some others: Force WWW: #Force www: RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC] Force non-WWW: #Force non-www: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
As you can see, .htaccess code can get complicated, so I don’t recommend writing your own unless you are an expert. Copy + paste, then test.
WordPress Plugins
Probably the most comfortable for non-technical site owners is to use wordpress plugins to handle 301s for you.
These plugins are easy to use, and avoid the risk of breaking your site completely. My favorite one is Simple 301 Redirects.
Simply enter your source and destination URLs, and you are good to go.
Registrar Level Redirects
Some registars will allow you to forward one domain to another domain. This is good if you are squatting on your brand name TLDs, or have some random properties that you want to keep for whatever reason.
Some registrars charge a yearly fee for this. This is robbery, don’t pay for it. Simply resolve the domain to a hosting account and redirect via htaccess.
When Should We Use 301s?
In reality, 301s pop up all the time. WordPress and other CMS will automatically rewrite URLs with small changes like trailing slashes (http://www.example.com/blog to http://www.example.com/blog/).
However just because they pop up all the time, doesn’t mean you should rely on them for internal linking, or be quick to decide to migrate or rename URLs.
Ideally 301s should be used only when necessary for larger projects or strategic decisions. For example, some big projects that require the use of 301 redirects:
- Full scale site migrations to new domain name.
- HTTP to HTTPS migration.
- The shuttering of one section of a site, being moved to another section.
They shouldn’t be used flippantly, because anytime you start messing with URLs, it can dramatically affect your SEO. Make sure to consult with an SEO expert and a web developer before undertaking a big scale migration project.
How Can We Use them for SEO?
If 301 redirects didn’t exist, the internet would break all over the place. We need the ability to declare a URL to now be in a new location.
Search engines utilize this as well, in order to take the authority, trust, and equity that one domain or URLs has built up in the algorithm, and transfer it to a new domain.
However, just like with any SEO tactic, search engines are aware of it and seek to combat manipulative tactics, so be careful. Follow these basic guidelines to avoid common pitfalls (but keep in mind that how google handles 301s can be unpredictable):
- There are many guidelines for site migrations, and this guide doesn’t purport to speak to that fully. Find a good one and use that.
- Target URLs should be topically relevant to origin URLs.
- Don’t mass 301 to the homepage, it doesn’t do what you think it will do. Instead, simply use a 404 page if the page doesn’t exist anymore.
- Be careful with acquiring properties and 301ing them. Make sure to monitor carefully after 301ing to insure no negative impact.
Conclusion
301s can be a great tool in your SEO tool belt, but just like anything else you must be wise and wary of overuse or manipulation. Be sure to document what you are doing, test and re-test to make sure you have broken anything, and when necessary call in a professional for guidance.
Happy 301ing!