A Technical SEO Guide to Redirects

Whether it’s a domain move, changes in the URL structures, redirect users to mobile website versions that match their end devices, or for many other reasons, redirects are needed. If done correctly, redirects help with search engine optimization and ensure that the page ranking of the old page is inherited by the new one. In addition, redirects help to give users the optimal user experience and thus to keep it or to win it over. Incorrect or missing redirects, on the other hand, not only damage the page ranking. In this article, we will explain the different variants of the redirects and what you have to pay attention to in this regard.

What are redirects?

A redirect by a client from one URL to another URL is called a redirect. We would like to briefly introduce you to the most common and most important reasons and purposes of the redirects:

  1. Moving from an old to a new domain
  2. Restructuring of the page directories
  3. Redirecting the user to a URL designed for mobile devices
  4. To prevent duplicate content
  5. To use several websites under one domain
  6. For redirecting to the user-relevant region when geotargeting

Good redirect, bad redirect

A good redirect means moving a website, redirecting it to the regional page of the website and to the mobile version for smartphones and tablets by means of geotargeting. These redirects have no disadvantages for the user.

A bad or malicious redirect is when the user is redirected to a page that he did not want to visit. These mostly spam sites or sites with questionable content. However, search engines usually recognize and punish this misdirection.

301, 302, 307 or 308 redirect?

301 vs 302 redirects

There are server-side and client-side redirects as well as permanent and temporary redirects that are relevant for search engine optimization (SEO). Forwarding codes such as 301, 302 and 307 hide different types of redirects, which we will go into in more detail.

301 redirect

The status code 301 (HTTP / 1.0) is the most common redirect and means “moved permanently. The 301 redirect is therefore server-side and permanent, which means that the redirect informs the client who requests that the desired content has been permanently moved. This forwarding also works when changing the request method from POST to GET. This redirect is also referred to as HTTP forwarding or server redirect because it was written in the HTTP protocol and is understood by every client (bot or crawler). Search engines like Google learn from the redirects via their bots that the old URL no longer exists and the search engine removes it from the index and inherits the page-ranking to the new URL to which it was forwarded. In the case of a server-side 301 redirect, a client requests a URL. This sends a request to the web server, which responds with a status code. This means that a redirection to another address has taken place, i.e. a redirect. 

The client calls up a new URL to which the user is redirected.

The aim of a 301 redirect is therefore to make content that was previously found under one URL (domain) available to the user on another, at best without the user noticing that he is being forwarded. To achieve this, a server-side, permanent 301 redirect is set. An incorrect or missing redirect leads to the dreaded 404 pages, i.e. the error pages with the error code ” 404 “. The chance of permanently scaring the user off with such a user experience is great, and the bots from Google are also hard hit with 404 error pages and duplicate content (DC).

The consequence is a deterioration in the page ranking, which is why the classic 301 redirects are so important.

  • Permanent relocation of the domain (cacheable) or a document / file
  • Restructuring of a website in which the URLs change (cacheable)
  • Change from insecure HTTP to secure HTTPS
  • When bundling URLS (cacheable)

Note: The redirect must remain in place until the search engines have indexed the new page. You can do a site query on Google if you want to know if all new URLs have already been indexed.

To set up a 301 redirect via PHP or an .htaccess file: 

The “mod rewrite” is required for forwarding via -htaccess

  • Example of a .htaccess file:
  •  RewriteEngine On
  • RewriteBase /
  • RewriteRule index.html newindex.htm [R = 301]
  • For the introduction via PHP you have to include a code snippet in the header of the HTML document. The PHP redirect is not a server-side redirect

302 redirect

The status code 302 (HTTP / 1.0) is a temporary client-side forwarding that states that the desired content is only temporarily available under a different URL. The new and the old URL are both listed and thus provide duplicate content, which is not well received by search engines and can lead to a poorer ranking or even exclusion from the search engine index. This forwarding also works when changing the request method from POST to GET.

This redirect was often misused to “hijack” domains in order to pass off other websites as their own. The browser interprets, for example, meta tags in order to get to the new destination, but only if the bot of the browser or the search engine is able to understand these redirect instructions, which is not the case with JavaScript, for example.

Examples of the 302 redirect: 

  • Geotargeting (not cacheable)
  • Affiliate campaign (partially cacheable)

The 302 redirect can also be set up via PHP or .htaccess file.
Example of a .htaccess file:

  • RewriteEngine On
  • RewriteBase /
  • RewriteRule index.html newindex.htm [R = 302]

303 redirect

This redirect is basically the same as 302, only that, unlike 302 and 307, it is never cacheable. The status code 303 (HTTP / 1.1) is also temporary and has largely been replaced by 307. This forwarding also works when changing the request method from POST to GET.

307 redirect

“Move temporarily” – a temporary redirect that is considered a better successor to the 302 redirect (HTTP / 1.1) and is therefore preferred for server maintenance. Here, too, there is duplicate content as with the 302, which always poses a risk for the ranking. For this, a PHP file with the redirect is written, which is saved in the root directory. Then a new htaccess file with the name htaccess.307 is created. This forwarding does not allow the request method to be changed from POST to GET.

This redirect is used for a short-term redirect. Examples of 307 forwarding:

  • Geotargeting (not cacheable)

308 redirect

With 308 redirects it is a permanent forwarding as with the status code 301. Unlike the redirect 301, the 308 (HTTP / 1.1) does not allow a change of the request method from POST to GET. In addition, the status code 308 is also only permitted for http 1.1-compatible servers, while the old redirect code 301 is still downward compatible.

What are JavaScript redirects with doorway pages?

Content in JavaScript is invisible to most search engines, which is why it is often used as keyword spam pages. This “doorway page” or “cloaking page” is stuffed with important keywords without making any sense in terms of content. The search engines recognize the keywords without being able to analyze the page, which is known as “Java blindness”. In this way, drawing users to your own pages without using a clean redirect, which is then redirected unnoticed to the website desired by the operator, is very risky and not recommended. Search engines are getting better and better at recognizing doorway pages and if one is recognized, the entire website can be excluded and permanently deleted from the index.

How do meta refresh tag redirects work?

Meta refresh tag redirects are an emergency solution if you do not have access to the server configurations. A provisional forwarding is created with a code for a meta refresh tag as an HTML command.

Which redirects for which goals?

  • Forwarding after domain transfer to new domain: 301
  • Forwarding to a new version of a product: 301
  • Forwarding to the regionally relevant version of the website using geotargeting: 307, 303, 307
  • Redirect to the mobile version of the website for smartphones and tablets: 301
  • Short-term redirection to new URLs when the website is rebuilt: 307 (or 302 – but not so recommended)
  • Forwarding from insecure HTTP to secure HTTPS: 307

Avoid so-called forwarding chains

It happens, again and again, that website operators redirect from a URL that has already been forwarded to another URL. These double redirects worsen the server load and increase the loading times of the pages, which in turn has a negative effect on SEO. You should therefore avoid creating chains of your redirects by recording all redirects in an overview. In the event of future changes, you can see at a glance which redirects already exist.

Do you have any questions about redirects and their function? Do not hesitate to contact us!

Leave a Reply

Your email address will not be published. Required fields are marked *