Redirects are an everyday occurrence in website optimization. They ensure that a URL is redirected to another URL when it is accessed with a browser.
With the 301 or 302 redirect, SEOs and webmasters can easily redirect a URL, both permanently and temporarily. So which redirect should you use when? We provide some useful insights in this article.
Redirects work mostly through an entry in the htaccess file. These are small text files for an Apache server containing instructions for the server. If a client tries to access a URL that is to be redirected, the server is instructed to redirect the client to the new URL. The .htaccess file is loaded from the server every time the page is accessed.
That's the general principle of server-side redirects. Check out this article for more general, detailed information about redirects. However, this article is primarily concerned with the 301 and 302 redirects. Let's start with the 301 redirect.
A 301 redirect is the most important one for SEO purposes. It ensures that one URL is permanently redirected to another. The status code issued by the server is therefore also 301 - moved permanently. The redirect passes the link juice from the "old" to the "new" URL.
Domain transfer: In this case, redirects ensure that the original URLs and directories are redirected to the new URLs and directories. Internal 301 redirects for individual URLs should be avoided as much as possible. Firstly, a chain of URLs uses up crawler resources, and secondly, the page speed will slow down the more the page is redirected. However, if URLs contain external links, individual pages can be redirected to preserve the link juice.
Changes to the website protocoll: If you encrypt your website with an SSL certificate using https, a 301 redirect is a practical way of redirecting your site from http to https.
URL structure changes: If you change the directories of your website, thereby changing the URL structure, a 301 redirect will ensure that visitors can immediately find the new URLs.
Transfer of individual documents: If you are offering a PDF for download at a specific URL, but you have redesigned the download area, a 301 redirect can point to the new download location.
301 directs help to prevent duplicate content, maintain the usability of your website, and offer your site visitors a flawless user experience. Ultimately, the redirect is a practical and useful way of optimizing your website’s user experience.
A 301 redirect can be set up indefinitely. Google itself does not specify how long a 301 redirect has to exist before it can be removed again. As a general rule, you should always wait until Google has indexed the new URLs.
You can run a site query to test if a new URL has already been indexed.
The key distinction between a 301 and 302 redirect is its duration. While the 301 redirect is "permanent", the 302 redirect is temporary. What both redirects have in common: They pass on page rank.
While the new 301 redirect URLs are included in the Google cache and thus indexed, a 302 redirect does not cache the redirect destinations.
Possible use of 302 redirects:
In most cases, 302 or 301 redirects are implemented using the Apache server's .htaccess file. It is also possible to redirect using PHP. For example, this method can be used for documents and is implemented using the document header.
For such redirects, the "mod rewrite" module of the Apache server must be enabled. This is accomplished by inserting various instructions in the .htaccess file that tell the server how to proceed with a specific URL or directory.
An example: In this case, page 1 will permanently redirect to page 2.
RewriteRule Page1.html page2.html [R=301]
If a 302 redirect is implemented, then in this example you must replace 301 with 302.
|What is it used for?||Temporary or permanent||Which redirect?|
|Changes to the URL structure||Permanent||301|
The following applies in general: All 301 and 302 redirects pass on the page rank. The only distinction between 301 and 302 redirects is if Google caches or does not cache the destination URLs.
The Ryte Website Success tool also shows you which pages are redirected via 301 or 302 redirect after clicking on status codes in the indexability area.
Figure 1: Display status codes with Ryte Website Success.
After clicking on the yellow tab, you will see all URLs that display the status Code 301 (Permanent Redirect). With the tool you can also see the redirection destinations.
Figure 2: Show redirection destinations of 301 redirects with Ryte.
By checking redirects regularly, you ensure that your website offers a good user experience. This will help ensure that Google receives positive user signals that are rewarded by Google and can ultimately contribute to good visibility in the SERPs.
301 redirects are an effective way to avoid duplicate content and are generally intended for permanent use. Like the 302 redirects, they pass on page rank, maintaining the "circulation" of your page with link juice.
302 redirects should only be used to a limited extent and for temporary redirects, as Google does not cache the landing pages.
Check your redirects with Ryte FREE
Published on 08/27/2018 by Philipp Roos.
Philipp is an extended member of the Ryte family and supports Ryte with the latest SEO know-how and digital marketing news.Become a guest author »
Get more traffic and customers by optimizing your website, content and search performance. What are you waiting for?Register for free