Detailed instructions for redirects: when and how to use them
This article will help you understand why redirects are required and how to use them. And, I hope, it helps experts better understand each other :)
What are redirects?
They are also used when you need to create a new page to replace an existing one and maintain the website position and traffic at the same time. There are nine types of redirects, but only three of them are actively used in SEO practice:
- 301 Moved Permanently (permanent redirect) indicates that the document has been moved to the new URL forever. When SEO specialists or developers talk about a redirect, they almost always mean a 301-redirect. The old URL disappears from the search results and is replaced by a new one.
- 302 Found, 302 Moved Temporarily (found, moved temporarily) indicates that the document is transferred temporarily, for example, takes the user to the page of the action (sale), without changing the contents of the old page. At the same time, the old page URL remains in the search results, because it has been temporarily moved to the new one.
- 307 Temporary Redirect means that the requested document is available for a short time at a different URL while retaining the request transmission method (GET, POST). Basically, it performs the same task as the 302-redirect.
General tips for setting up redirects
The more relevant the acceptor page (the one that accepts the redirect) to the donor page, the faster they will stick together, and the more weight it will transfer.
2. Avoid using a redirect where you can set a rel = canonical
If the content of the pages is duplicated, but it's important for you to leave the pages accessible to users, use rel = canonical instead of a redirect. For example, if there are several versions of the content (for printing, mobile, etc.)
3. Don't use redirects for robots.txt
It's important when changing a domain or moving to a secure protocol; the old robots.txt is accessible to robots, so domains are stick together faster.
4. Avoid two, three or more redirects in a row
Each new redirect means loss of load time, extra load on the server, and possible loss of the transmitted page weight.
5. First use page redirects with a higher level of nesting in the .htaccess file, for example:
- first goes the redirect from site.com/category-1/subcategory-1/ to site.com/category-1/subcategory-2/;
- then from site.com/category-0/ to site.com/category-0;
- and the last go global rules such as redirecting all pages without "/" to pages with "/".
6. Browsers cache redirects: reset cache or use specialized services to check their operation.
Some SEO-experts advise you first to configure 302-redirects, and after the newest pages appear in search results, change it to 301 in order to exclude the possibility of losing traffic.
Please be warned that such a use of the 302-redirect is contrary to the recommendations of Google, but no one forbids you to do experiments :)
In Serpstat, you can see redirects in two ways: in the summary report and in the personal report.
.htaccess syntax and characters
301-redirect: .htaccess examples
If the page URL differs by at least one character, search engines consider such pages to be different. And if these are different pages with the same content, then they are duplicates.
Therefore, it's extremely important to ensure that all page URLs are only lowercase and of the same format (with a slash or without a slash at the end). As in the case with www, set up redirects to the version of pages with which you have more in the index.
You need to understand that when setting up redirects to https, the ability to send http requests to the website is still activated. HSTS tells the browser not to "communicate" with the website through http.
Even if the browser encounters an http link on this website, or the user enters it manually, he will send the request immediately to the https version and will not go the way when the request is sent first to the http version, and only then the server itself uses a 301redirect to https. This is done to protect the user from possible wedges and redirects of cool hackers and intruders. Search bots will not fall under this scenario.
302 and 307-redirect: how to use it correctly
- It's important that the original page continues to be indexed. For example, you have an online store, and some product has ended, but there is a very close analogue of it. Then, while the product is out of stock, you can redirect users to the page with its analogue.
- The landing page will frequently change. For example, for requests such as "concerts in NY today," you can make 302-redirects to a page with the current date on the website every day.
- Links are placed on the original page, which should be further indexed.
For search engines, a 307-redirect is an almost complete prototype of 302.
The only difference is that the 307-redirect saves the request transmission method, while 302 can behave unpredictably with methods other than GET (i.e., POST, PUT, DELETE).
How to quickly find excessive redirects on a website
Serpstat website audit works on the same principle as a search robot. The examination will indicate the weaknesses of your website in which it doesn't meet the requirements of search engines, including the redirect chain, and also suggests ways to eliminate these errors.
In order to check the website for errors, you must first create a project and make the appropriate settings.
After the examination is completed, you will receive a selective summary of the errors. All SEO vulnerabilities will be prioritized: from high, i.e., errors that threaten positions, to low, i.e., errors that are less dangerous but require correction.
There is also a unique tool available in Serpstat, which is a "One Page Audit". Using it, you can check for technical problems not the entire website, but only certain URLs. This tool saves time and user limits, helping to track the effectiveness of SEO optimization.
- if you need to permanently change the page or transfer the link weight you can use 301-redirects;
- if the landing page changes frequently or redirects for a short time use a 302-redirect;
- if the request transmission method is not GET, and it's important for you to process it correctly, use 307-redirects instead of 302.
Learn how to get the most out of Serpstat
Want to get a personal demo, trial period or bunch of successful use cases?
Send a request and our expert will contact you ;)
Cases, lifehacks, researches and useful articles
Don’t you have time to follow the news? No worries!
Our editor Stacy will choose articles that will definitely help you with your work. Join our cozy community :)