What is a 301 Redirect?
A 301 redirect is an HTTP response code signaling that the web page has permanently moved to a new location. Depending on the type of website, this might be because it has been shut down or perhaps just relocated somewhere else.
The 301 Moved Permanently response specifies that the web page has permanently moved to a different location. The web server redirects everyone (not just search engines) to the new URL specified in the Location header, regardless of their user agent.
A 301 Permanent Redirect is one way you can communicate changes to your website visitors and inform search engines like Google, Bing or Yahoo about significant website updates. It’s worth noting that this isn’t the only type of redirect you might decide to implement on your site.
When Would You Use a 301 Redirect?
Following are some reasons to use a 301 redirect; let’s explore.
Changing A URL:
Let’s say you want to change the main URL of your website. Maybe you bought the domain name www.example.com but now prefer www.example-mirror.com instead. If this is the case, you’d probably want to 301 redirect users and search engines from example.com/page1 or blog.example.com/category.html to www.example-mirror.com/page1 or category.html, respectively, so that any future reference to the old pages uses the new domain name instead.
Maybe you want to change the content of a page but don’t want old links pointing to that page to no longer work. Using 301 redirects, you can always make sure that anyone clicking on an older link is immediately taken to the new version of the content. This ensures that the old version of the content doesn’t show up in search engine results. This is fine if you don’t keep the old content up.
Streamlining Your Website:
If you’re migrating, moving or restructuring your website, then that will generally mean changing the paths to some of your files too. If anyone who’s crept links are still pointing to the old location, they’ll probably break when you move things around. Use 301 redirects as a safety measure to ensure that you don’t lose traffic from these sorts of broken links. It’s worth pointing out, though, that 301 redirects also leave a footprint in the site’s logs, and search engines will index your website based on these. This can become a problem if you regularly change things around, making it harder for other websites to link to you because of all the changes they’d have to consider.
Adding Parameters to URLs
If you have a section of your site, for example, http://example.com/blog, you may want to add parameters to the URL when someone gets there, e.g., http://example.com/blog/?p=4, which is usually done in WordPress by adding this line of code in the Main Index Template file.
Search engines will index URLs with additional information appended without the redirect. If you’re planning to send traffic directly to that page, it might be a good idea to 301 redirect non-www or www versions of your site’s URL to ensure that this information isn’t indexed or forwarded by search engines.
Migrating an Existing Website During a Phased Web Launch:
Suppose you’ve developed a new website but aren’t ready to launch it yet because there’s still some work left to be done on it. In that case, you can use 301 redirects to allow Google and other search engines to crawl your production site while keeping the server from sending any traffic for real visitors. This way, once the new site is ready for prime time, you can go live immediately with minimal downtime.
What Causes a 301 Redirect?
When the crawler comes across a URL on your site that redirects to another URL, it understands that this is an attempt by you to fix something, so it treats it as such, i.e., adds the new, corrected URL to its database carries on crawling your website usually.
A 301 redirect is caused by the server sending a status code of 301 (Moved Permanently) and a Location header to all search engines and user-agents requesting the old URL. This doesn’t mean that users will also see a 301 response. If you look at your server’s access logs, you’re likely to see a 200 (OK) response but no 301 redirect in the response headers because browser requests aren’t sent to your web server with a parameter that would enable this.
How Do I Set Up a 301 Redirect?
To use a 301 redirect, you need access to your website’s .htaccess file. This is most often located in your site’s root directory (e.g., www.example.com/.htaccess). If it isn’t there, you’ll need to ask your hosting company where it is.
You also need to know the URLs of all your old, broken links.
The easiest way of doing this is by using a 301 redirect checker. If you don’t have access to an old website, use Google Webmaster Tools to find them (Tools > Site map).
You can set up a 301 redirect for one file or redirect an entire folder.
Redirecting individual files is done by adding the following code to your .htaccess file: Redirect 301 /oldfile.html http://www.example.com/newfile.html
Redirecting folders is done using .htaccess by adding the following code to your .htaccess file: Redirect 301 /folder/ http://www.example.com/newfolder/
If you’re using WordPress, enter the full path to the new file without the http:// prefix. For example, if you’re moving a file called “oldfile.html” in your root directory to a file called “newfile.html” in the exact location, you’d use this code:
Redirect 301 /oldfile.html http://www.example.com/newfile.html
Don’t forget the trailing slash on your redirects! If you’re having problems with your redirects, it’s because you’ve forgotten the trailing slash!
Are Redirects Bad for SEO?
They aren’t bad for SEO themselves, but they can be misused. For example, suppose you’re doing a phased web launch of your new website and using redirects to prevent search engines from indexing or crawling pages that are still under construction. In that case, the temporary site must have good content. Otherwise, you’ll be passing link equity to your temporary site, which you want to retain for the main website.
Using redirects in this way will disrupt link equity flow. However, it won’t be deleted (Google should recognize that linking to your old pages is valuable). It will simply flow to the new location instead of remaining on the old one. This could result in slower crawl rates initially, but you should still see reasonable crawl rates over time.
Are 301 Redirects Bad?
301 redirects are not bad in themselves. 301 is an official status code recognized by search engines (we use it on our site for this very reason). If Google finds your 301 redirects, it doesn’t necessarily mean they’re bad for you. It simply means you’re taking action to fix broken links on your site.
However, if your redirects don’t point to something that makes sense (i.e., the content has moved somewhere that makes no sense at all), then you could be doing more harm than good. Google’s algorithm recognizes 301 redirects. They should not be rewritten or redirected through a file. They can very quickly get out of hand and lead to duplicated or multiple content issues, which in turn can severely hurt your rankings.
Does 301 Redirect Affect Google Ranking?
That’s a myth. When a webmaster 301 redirects a page from an old domain to a new one, the old domain is still indexed by Googlebot, and the link equity (ranking power) of the pages on it should pass to other pages on the same site. Google will not re-crawl them again because they are redirected (301), but updating the index may take some time. The old page’s link power will be transferred to other pages on that site until it eventually disappears from the cache.
Subsequent 301 redirects, however, can harm rankings for specific pages because they signal to Google a possible change of a page’s content or structure, and in turn, will slow down crawl rates if not implemented properly.
What’s the Difference Between a 301 and a 302 Redirect?
A 301 redirect is a permanent way of telling search engines that the URL has moved to its new destination permanently. A 302, on the other hand, tells search engines that this page is temporarily unavailable and they should index the new location instead.
As such, Google recommends using 301 redirects over 302s because you can never be sure when a site will change location. The 302 redirect only returns a temporary code that tells Google to index the new address but doesn’t communicate that it’s not going anywhere.
Which is Better, 301 or 302 Redirect?
The 301 redirect is best for SEO. It tells Google that the page has been permanently moved to a new location and passes all value from the old page to the new one, including any ranking power of inbound links pointing to it. A smaller value will be passed if you use a 302 redirect since it’s only a temporary code indicating that the page has been moved temporarily. In addition, using a 302 redirect can cause duplicate content issues with pages on your site since an entirely new URL will appear in search results, despite containing identical or near-identical content to the original page.
In short, use 301 redirects over 302s unless you have a specific reason not to.
The Bottom Line:
Sources & External Links:
- Usage Statistics and Market Share of Content Management Systems, January 2022
- Usage Statistics of Default protocol https for Websites, January 2022
- HTTPS as a ranking signal
- Open redirect URLs: Is your site being abused? | Google Search Central Blog | Google Developers
A Guide To 301 vs 302 Redirects For SEO - Search Engine JournalMarch 11, 2022 - Search Engine Journal
A Guide To 301 vs 302 Redirects For SEO Search Engine Journal...
SEO Best Practices for Migrating to Shopify - Search Engine JournalMarch 11, 2022 - Search Engine Journal
SEO Best Practices for Migrating to Shopify Search Engine Journal...