What is a redirection
Website owners often set up redirects for pages that are broken, contain duplicate content, or have moved to new URLs. This way, both users and search engines access the most relevant or updated page. This is beneficial for user experience and can prevent SEO issues, potentially aiding in higher website ranking.
Why Use Redirects
There are several reasons why webmasters use redirects to guide a user to another URL. Let’s explore each of them.
1. To Guide Users to the Main Version of a Website
You might have noticed some websites use HTTPS protocols, while others use HTTP. The same goes for URLs with and without the ‘www’ prefix.
The protocol you choose, and your decision to include or exclude the ‘www’ prefix, defines your website’s main version, i.e., the URL displayed in search results. Users are redirected to this version if they use any alternative URL.
For example, https://dazzet.ca/ is our website’s main version. That’s why when users enter URLs like http://dazzet.ca/, https://www.dazzet.ca/, and http://www.dazzet.ca/, they are redirected to the main version: https://dazzet.ca/.
In this case, redirects are necessary to avoid duplicate content.
2. To Prevent Duplicate Pages
- Duplicate pages can appear not only due to different protocols and ‘www’ prefixes in the URL but also for other technical reasons. In cases where multiple pages contain the same content, webmasters delete the duplicate pages and set up a redirect to the page with the original content.
Common situations where redirects are used to prevent duplication include:
- Redirecting URLs with a trailing slash to URLs without it. When users enter a URL, they probably don’t add the trailing slash. But when a browser automatically adds it, it’s due to redirects. Just like with protocols and ‘www’, webmasters need to decide whether to use trailing slashes or not.
This helps avoid duplicate content.
- Redirecting URLs with file extensions. Sometimes, a URL may have a file extension at the end, like .html, .htm, .php, .aspx. To ensure users reach the correct version of the page, like https://site.com/page.html instead of https://site.com/page/, redirects need to be implemented.
3. To Maintain Link Juice and Traffic from an Old URL
You may need to change a URL for various reasons:
- When switching to a new CMS.
- When changing your website’s structure.
- When trying to eliminate all duplicate pages.
As a result, you’ll have a page with a new URL that continues to align with the same user intent. Redirects not only allow redirecting traffic to a relevant page but also maintaining the flow of links.
For example, you have a page about festivals in 2020: https://site.com/festivals-2020/. You want to update it and publish information about next year’s festivals. You create a new page, https://site.com/festivals/, to remove the year “2020” from the URL.
This page will contain not only the new information but also the old content published on the previous version of the page. To avoid this confusion, you can delete the old page, https://site.com/festivals-2020, and redirect it, along with all the traffic and links pointing to it, to the new version of the page, https://site.com/festivals/.
4. To Merge Multiple Domains into One New Domain
If you’re moving your website to another domain, you may need to redirect visitors and crawlers from the old site to the new one. As you might have guessed, this is where webmasters also utilize redirects.
Types of Redirects
There are two main categories of redirects: permanent and temporary.
While users can’t tell the difference, they are significant for search engines. Here’s why:
Permanent redirects are used when there is no expectation of showing the old page again. For example, if you delete a page or combine duplicate pages. These redirects tell search engines it’s okay to remove the old URL from search results and start displaying the new one.
Then there are temporary redirects, used when a page needs to be redirected for a short time. For instance:
Say you’re performing maintenance on your website. You might temporarily redirect users to a message indicating they should check back after the maintenance is complete.
With a temporary redirect, Google generally keeps the old URL in its index longer than with a permanent redirect. This is because a temporary redirect indicates that the old URL will become the main one again at some point in the future.
Since redirects are signals to Google, it’s important to choose the right one to communicate what you want to do with a particular URL.
1. HTTP Redirects
The user’s browser requests the old URL (redirected). The server automatically displays the webpage for the new URL (the redirection destination). From the user’s point of view, HTTP redirects are completely invisible.
Technically, they are called server-side redirects, as your web server (where your website is hosted) handles it before your website loads. It does this by responding with an HTTP 3xx code when it receives the request for the redirected URL. These 3xx codes are like instructions for your browser. They indicate that the requested URL has been redirected and where to find the new webpage (the redirection destination).
Here’s a simple list of the most common types of 3xx codes (and what they mean when a server sends them). We’ll go into details of each below:
- 301: Moved Permanently
- 302: Found and Temporarily Redirected
- 303: See Other
- 307: Temporarily Redirected
- 308: Permanently Redirected
301 redirects tell Google that the move is permanent. They are also considered the best way to transfer link equity (link power) if you need to redirect a page. This is because they transfer some page authority from the old URL to the new URL.
But keep in mind that page authority diminishes with each 301. So, only use them when necessary.
Let’s look at a real example of how 301s work.
Suppose your site has two pages about dog toys. There’s no need for two pages on the same topic. And one page is outdated.
In this case, it would be better to delete the old, outdated page and redirect its URL to the URL of the new page.
302 Redirects (Found and Temporarily Moved)
Another common redirect is the 302. A 302 redirect tells Google that a redirection is temporary.
Although temporary, 302 redirects can still transmit page authority from the old page (although it happens over time).
Use a 302 redirect when:
- You temporarily move your page to a new URL.
- A page is under maintenance.
- You want to conduct A/B testing of a new website design or copy.
Unsure when to use a 302 instead of a 301
In general, only use a 302 if you plan to reuse the original URL at some point (or set up a new one).
Other HTTP Redirects
Regarding server-side redirects, in most cases, you’ll only need to use a 301 or a 302.
But there are other types of HTTP redirects. These are much rarer, but still good to know about in certain situations:
- 303 Redirect (See Other): Redirects users to another relevant page when the old one is unavailable (more common when users have already submitted a form and cannot resubmit).
- 307 Redirect (Temporarily Moved): Similar to a 302 redirect but handles server requests for the webpage differently (302 redirects are generally considered better for SEO).
- 308 Redirect (Permanently Moved): Indicates a permanent move and is treated the same as a 301 (although it can make your reports confusing if you switch between the two randomly).
Meta Refresh Redirects
Meta refreshes occur at the page level (client-side) rather than at the server level. This means they happen in your browser instead of on a server, unlike HTTP redirects.
If you need to make a redirect, HTTP redirects are better than meta refreshes for SEO since meta refreshes can confuse both Google and website visitors. They’re slower (harming user experience) and could lead to Google indexing the wrong page.
However, Google only recommends meta refresh redirects if a server-side redirect can’t be used. This is because they’re slower and don’t pass as much link authority.
There are two types of meta refresh redirects: instant and delayed.
- Instant meta refresh redirects trigger as soon as a page loads in a browser. Google interprets them as permanent redirects.
- Delayed meta refresh redirects trigger after a set number of seconds you choose. Google interprets them as temporary redirects.
And this could harm your website’s ranking in search results.
How to Implement Redirects
There are three main ways to set up HTTP redirects:
- Through plugins. If you’re using WordPress, Redirection is a solid choice.
- Through your CMS (content management system).
- Through a .htaccess file.
Juan Esteban Yepes