•
15-minute read
Redirects are the way we can direct traffic from one URL to another. They’re easy to implement yet dangerous if managed improperly and can even cause sudden ranking drops.
So, why not get the matter sorted out today? In this article, you will find out what types of redirects you can use on your site, how to implement them, and what mistakes to avoid.
There are 8 cases when you need to resolve your existing URL to a new one:
When you click a link or enter a URL in the search box and press Enter, your browser sends its initial request to the site server.
Then, the server responds with an HTTP status code. If it’s 200, it means the request is processed. The server starts to collect all the files found on the page and then transfers them to the browser.
However, when a server wants the user to visit a different page rather than the requested one, a 30x HTTP status code is returned. It contains a ‘location’ header with a new target URL.
Your browser, in return, sends another request, but to the new location this time. The server processes the request and returns 200 HTTP status code. It means success. The server collects all the files on the page and starts to transfer them to the browser. And you can finally see the page.
That’s how server-side HTTP redirection works. This is the most commonly used type of redirection. But there is another type that is less common — client-side redirection.
A client-side redirect (HTML meta refresh, JavaScript redirect, Crypto redirect) is implemented by code inside the content. It instructs the user agent (browser) to retrieve content from a different URL. So, it’s the browser itself that performs the redirect.
Client-side redirects are slower and more confusing for users. These redirects are triggered after the page or part of it is loaded in the browser. In contrast, server-side redirects are performed during request processing.
So, it’s preferable to implement redirects on the server side. However, content creators do not always have control over their server configuration. And that’s when you should remember that you still have options — client-side redirects.
Redirection can be temporary or permanent. Here is a cheat sheet of all your options:
Now, let’s consider each type of redirection in detail, going from server-side to client-side redirects.
301 is a server-side redirect indicating that the page is moved permanently.
You should use it when you permanently move a domain or a page, change the site structure, or migrate from HTTP to HTTPS.
With 301 redirect, you tell search engines that you want them to apply all the SEO value of the old page to the new one. Thus, PageRank is passed, and the link juice and organic traffic can be preserved.
PageRank is an algorithm that Google invented to measure the importance of webpages. It’s believed it counts the number and quality of links coming to and from a page to determine how important the website is. Google’s assumption is that authoritative websites are likely to receive more links from other websites. It means the more links a web page has, the more authority it gets.
PageRank value can be passed from one page to another through links and redirects.
We have an informative post about PageRank, I recommend reading it in case you want to understand how authority and backlinks work on Google.
302 is a server-side redirect indicating that a page is moved temporarily.
It makes sense to use it for marketing aims: geo targeting, device targeting, A/B testing, and traffic tracking. The reason it’s not used for SEO is that when you set up a 302 redirect, the original URL remains indexed and continues to rank.
There is no clear evidence if such redirection passes PageRank or not. You can encounter two opposing opinions on that matter on the web. However, Google claims if you apply 302 and then forget about it for a long time, it will consider it a permanent redirection. Probably, PageRank will be passed then.
303 is a server-side redirect indicating that the server is temporarily redirecting the user agent to a different resource and that the original page should not be requested again.
So, it’s only used when you want to redirect users from a submission or an authorization form to a confirmation page or an upload progress page. Form resubmission becomes impossible, thus, you can prevent accidental duplicate transactions. Plus, your server won’t be overloaded because of too many requests.
Just like the temporary 302 redirect, 303 redirect does not pass PageRank and is not applied for SEO purposes.
307 is a server-side redirect indicating a temporary redirect. Basically, it’s a newer and technically cleaner alternative to 302.
The thing is that 307 redirects don’t allow you to change the request method (from Post to Get). When you use 307, the client must repeat the exact same request on the target location. That’s why it’s considered more predictable and clear. So, if you aren’t sure what kind of request the site gets, it’s better to use 307. The same is true for 308 redirects.
Its use cases are the same as for HTTP 302 — it’s applied for marketing aims most of all. Use it if you need a client to follow a redirect and search engines to index both old and new URLs.
As you may have guessed, such redirection is not supposed to pass much or any PageRank.
308 is a server-side redirect indicating that the page is moved permanently. It is almost the same as 301 but, again, technically cleaner.
This type of redirection can be used for the same purposes as 301: when moving a domain or a page permanently, changing the site structure or its protocol. Plus, you should use it when moving a very complex website with a lot of submission forms.
When you use this redirect, you tell search engines to replace your old page with the new one for good. That means PageRank is passed with this redirect.
Meta refresh is a client-side HTML redirect. Unlike all the redirects described above, meta refresh redirects browsers to a different web page after a specified timeout.
If it’s 1 second or more, it is called delayed meta refresh. Here is how users see it:
There is also instant meta refresh variation, which is performed without delay (0 sec).
Fun fact: Back in the days of the early web, meta refresh was widely used to create sneaky redirects for doorway pages. It is considered a negative SEO practice. So, both webmasters and search engines may be biased against this type of redirection.
Now, meta refresh is used only if you have no access to your site server configuration files (.htaccess or nginx.conf).
It’s worth saying that meta refresh may lead to issues with usability, which in turn may affect rankings. Nobody wants to wait, say, 5 seconds till the page is loaded, agree?
According to Google, they can treat meta refresh as a real redirect. However, there is no guarantee that meta refresh will pass PageRank.
JavaScript (JS) redirect is a client-side redirect. With it, you can “advance” the redirection, e.g., you can detect the language that is used by a browser and redirect to the right language page based on that.
Use this type if you want to base redirection on user interaction, for cross-browser redirection, and device targeting. Or in urgent cases when you don’t have another choice.
Google says it is now quite good at JavaScript redirection processing. However, we can’t say for sure if it passes PageRank like some of the 30x redirects.
Crypto redirect is a client-side redirect, and it should be used only in case you can’t implement all other options.
Don’t be confused by the crypto part — this redirection type has nothing to do with cryptocurrency. Google has been using the word crypto for quite a long time. Basically, it means that it’s a soft redirect that is established externally, i.e., right on a page.
This type of redirection is basically a link pointing to a new page accompanied by a short text, e.g., The site/page is moved due to a cyberattack. Go to the new site.
From an SEO point of view, a crypto redirect is useless — it doesn’t pass much authority from an old page to a new one.
Server-side and client-side redirects are set up differently. It all depends on your site’s host, server, and scripting language. Implementation will also vary depending on whether you are going to redirect a single URL or multiple URLs.
To save your time, I will provide examples of a permanent single-page redirect for each type. Thus, you will get an idea of how to implement or control the implementation of redirects.
If you use PHP scripting language, you just need to use the header() function. Example:
<?php
// 301 Moved Permanently
header("Location: http://www.example.com/brand-new-url.php", true, 301);
exit();
?>
Note: If you do not specify the status code explicitly, e.g., true, 301, header ("Location: URL") defaults to 302 (temporary redirect).
If your site is hosted on Apache, you can add specific rules to your site’s .htaccess file. Example:
If your server runs on Nginx, you need to add a server block to your nginx.conf file. Example:
server {
# Permanent redirect to an individual page
rewrite ^/old-url$ http://www.example.com/brand-new-url permanent;
}
If you use a CMS, you should use their plugins, extensions, or in-built functionality. It’s better to consult your CMS’s help center.
To set up meta refresh, place the meta refresh element either in the head section of the HTML or in the HTTP header of the server side code. Example:
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="2; url=https://example.com/brand-new-url" />
<title>Page title</title>
<!--...-->
Note: The example shows how to set up a delayed meta refresh (with a 2-second delay). If you want to set up an instant meta refresh, set the value of the content attribute to "0". Instant meta refresh will be less confusing for your site visitors.
To set up a JavaScript redirect, set the location property to the redirect target URL in a script block in the HTML head. Example:
<!doctype html>
<html>
<head>
<script>
window.location.href('http://www.example.com/brand-new-url')
</script>
<title>Page title</title>
<!--...-->
To set up a crypto redirect, you just need to place a link pointing to the new page accompanied by a short explanation. Example:
So, do redirects harm or benefit SEO? In fact, they can do both.
Don’t be afraid of these “threats.” They can come into reality only if you redirect in the wrong way.
Now, check out the top 6 URL redirection mistakes and make sure to avoid them.
When setting up a redirection, you should remember about your visitors. Will they get the answers they expect to get after they are redirected?
You need to make sure that the new content won’t confuse them. If a user clicks a link anchor vegan chocolate and is redirected to a page gluten-free products, that will be upsetting. It may result in increased bounce rates and traffic loss.
How to avoid this mistake: You should always redirect to a page with a similar topic.
Redirect chains appear when there is more than one redirect between the initial URL and the destination URL. E.g., Page 1 > Page 2 > Page 3 > Page 4 > Page 5.
The problem with redirect chains is that they overburden the crawler. Google claims their crawler follows up to 5 redirect hops and then stops. So, if there are more redirects, the destination page may not be indexed at all. Plus, you may lose all the link juice and slow down the page load time.
Loops are similar to chains, but in this case, the initial page ends up redirecting back to itself. E.g., Page 1 > Page 2 > Page 3 > Page 1. This way, you do not redirect visitors to a new URL at all, which is such a waste of your crawl budget and link equity.
Redirect chains and loops are so vicious because they're super easy to overlook. The only way to avoid them is to consistently keep track of your redirects.
How to avoid redirect chains: You can quickly audit your site for 301 and 302 redirect chains with WebSite Auditor.
Launch the tool and proceed to Site Structure > Site Audit. Find the Redirects section and then click on Pages with long redirect chains.
Download WebSite AuditorIdeally, there should be none of them. For example, the situation in the screenshot is very sad.
If you find a redirect chain, fix it by redirecting the initial page to the destination page directly. If for some reason you can’t redirect from the initial page to the final directly, try to reduce the number of redirects in a chain as much as possible.
Many webmasters do not understand the difference between 301/308 and 302/307 redirects. They know that the former is permanent, and the latter is temporary. However, they don’t take into account that if you use HTTP 302/307, the old page is still being indexed and almost no link juice is passed to the new URL. That’s important.
Though Google understands that you might have used 302 by mistake and can treat it like 301 over some time, you can’t know how much time it will take. And time is money.
How to avoid the misuse of temporary redirects: Use 301 or 308 if you don’t plan to remove the redirect in the near future — if it’s not for a promo campaign or A/B testing.
If you do SEO right, all your site’s pages are interlinked. And if you redirect one of those pages to another one, you’ll end up creating too many redirects. Those redirects are completely unnecessary, as you can totally replace these internal links by pointing to the new URL.
How to avoid creating unnecessary redirects: First, you can find the pages that point to the old page (i.e., the one that is redirected to a new URL) in WebSite Auditor:
All you have to do now is replace the old internal links with the new destination URL.
If you use 301 or 308 (permanent) redirects, you should depict that on your sitemap so as not to confuse the crawler.
As you know, a sitemap instructs search engines to go and index some URLs. If you haven’t removed old URLs from your sitemap, the crawler will go to this URL and will try to index it. But instead of getting 200 (OK) response code, the crawler will be redirected to another URL. This can lead to indexability issues.
How to keep your sitemap clean: Keep your sitemap in order — remove the old redirected URLs and add the new URLs to your sitemap.
You can quickly generate a sitemap and then upload it to your server via FTP with WebSite Auditor.
After you implement all necessary redirects, launch the software and go to Site Structure > Pages. Click Website Tools > Sitemap.
Download WebSite AuditorIn the Sitemap Generator tool, choose which URLs to add or remove from your sitemap. Once done, click Next to move on to publishing.
Download WebSite AuditorIt’s hard to detect on your own if your site has suffered from URL redirection. Most likely, you won’t even know that you did something wrong. That’s why regular site audits are a must-do for webmasters and SEOs.
How to prevent serious redirect issues: Use WebSite Auditor to check your whole site for some technical issues that might have appeared because of redirection.
Launch the software and go to the Site Structure module > Site Audit. You will see a list of all possible issues and their statuses.
Scroll down to the Redirects section. There, you will find all the common redirect issues that can negatively affect your site performance and user experience.
Download WebSite AuditorClick on any to see the details on the left. If the issue is marked as Error (in red), you should fix it as soon as possible.
Here are the common questions about URL redirects, both beginner and professional SEOs ask.
A couple of redirects won’t affect your site speed, while a huge number of redirects (e.g., many thousands) will surely do.
What will affect your site speed for sure is redirect chains and loops. So, you’d better avoid them if you want to keep your Core Web Vitals healthy.
You can check your page speed with WebSite Auditor to see if redirects played a bad trick on your site:
Launch the software and go to Site Structure > Site Audit. Then scroll down to Page Speed and find the Avoid multiple page redirects line.
If redirects have affected your page speed, the line will be marked as Error (in Red) and you will see the pages that contain redirects that need to be fixed.
Download WebSite AuditorYes. For example, redirect chains can cause some trouble for your SEO. The reason is that search engines don't make it through to the final destination page immediately in a chain of redirects. If you have Page 1 > Page 2 > Page 3 > Page 4, they won’t treat it like Page 1 > Page 4.
When Google receives a 30X response code, it requests the next URL and the next one, etc. Thus, the wait time for the crawler increases, and ultimately you waste the crawl budget. That may lead to indexation issues with time. And not much of PageRank will be passed to the destination URL.
Another thing that can also complicate indexation is the abundance of internal links with redirects.
And of course, as client-side redirects are not considered SEO-friendly, they won’t benefit your site.
Redirects do not affect rankings directly. Though, we can’t deny that if used incorrectly, redirects can affect your SEO negatively. That, in turn, may lead to lost positions on SERPs.
There are one thing to remember: Search engines treat a canonical tag just as a signal and not a directive. They may choose another URL canonical if they consider it more appropriate. And then your plans to have a certain page indexed instead of another will be ruined.
So, if you want to direct traffic from one page to another, 301 (or 308) is a more rational choice.
In brief, here's what you can take away from this article: