Redirects - 301 and others – what are they and how can I use them?

Updated on: 2019-11-29
301 redirect
A lot can be read in articles, on social media and in discussion forums about a whole range of different redirects. Redirect 301 seems to be the answer to all our internet woes regarding what can happen to our website. A punishment from Google? Redirect. A new version of the site with a different addressing structure ? Redirect. Increased strength of subpages? Redirect. But what is a redirect anyway…?
Start earning money today.
Sign up for free

Table of Contents

What redirects are and how to use them

Is there anything worse than having your favourite kebab stall that you visit every day suddenly moved somewhere else? Worse than that – you don’t know where to! No sign or note – nothing! Michał Sadowski, the owner of Brand24, would definitely be able to share his experiences on this issue.

So what has a kebab stall to do with the Internet and SEO? Well, a user accessing your site XYZ might be just as confused if they have always found meaningful, useful content there and all of a sudden it disappears. Just gone. The only thing they see is the message: ‘The page you are looking for does not exist’. The GoogleBot might also get somewhat confused when it has to deal with a lack of content at a previously used address. This, of course, can then have a knock-on effect on your site’s visibility in search results.

So what can you do to make sure your user doesn’t feel confused? All you need to do is put up a sign reading: ‘We have moved just around the corner’. For internet sites, you need to use redirects.

But let’s put kebabology to one side.

When you’ve got a website, sooner or later you will come up against the problem of transferring data/info from one address to another. It might be a new domain name or simply moving a subpage.

Whatever the reason, it’s worth ensuring continuous access to your information – assuming, that is, that it is worth it. So how do you find out if it is worth it?

Google Analytics

Log on to your Google Analytics account and go to the Behavior report. Next, select Overview, and in the table on the right, select 'view full report'.

After clicking, you will see quite a complicated table with a large amount of data. Here you are most interested in the search field. You can paste here the address of the page that you’re looking into and needs moving, and check if this particular subpage is generating traffic.

After all, it might turn out that the subpage you are planning to move generates only 10 views out of a million in total. In cases like these, it is highly likely that using a redirect is not necessary.

However, to make sure whether it is worth bothering with a redirect for a given page, you can do one more test:

Majestic SEO

Even the free version of the Majestic account allows you to find out if it’s worth setting up a redirect. If it turns out that the subpage does not generate traffic, but it does contain a lot of links, you could consider redirecting the address to a similar subpage or to the main page. Thanks to this, the links won’t be lost and the strength of the website will remain virtually untouched.

If the address doesn’t contain any incoming links, setting up a redirect may be pointless.

Complete redirect

Of course, if you’re redirecting, for example, an old version of an online shop to a new one, it is most likely that it won’t be worth focussing on individual subpages, instead it’s better to redirect everything from the old address to the new one.

One common strategy for redirecting an old shop to a new one is to redirect old product subpages to new subpages of the same category. In this way, the shop owner can be sure that a user will end up on a page that is most similar to the one they were looking for. This is a good solution, especially for large pages, where it is not clear whether we will be able to do a 1 : 1 redirect – that is 1 old product subpage redirects to 1 new subpage with the same product.

Redirecting – so what is it exactly?

Redirecting is the way that the www server for the internet page being viewed informs your browser of the need to go to a different address in order to access the content. There are several ways of doing a redirect. The most popular is editing the .htaccess file in which you enter the necessary rules.

Redirecting can be divided up according to the code sent by the server to the browser.

Redirect 301 (permanent transfer) is the most popular way of redirecting.
This redirect is treated by Google robots as: ‘the content was available at address A, but will now only be available at address B’. Using this type of redirect means that the content is available in the search results only at one target address. This redirect is helpful, for example, when removing duplicate content. The user usually does not even notice that they have been redirected as this occurs before any files connected to the page have been loaded.

Redirect 302 (Found) is very similar to redirect 301. The main difference is that the indexing robots treat this type of redirect as ‘temporary’. All this means is that the browser index includes both the old and the new address. From the user’s point of view, it is hard to observe the moment when the address is changed.

Popular 301 redirects

We are often asked how to redirect a page from a version ‘without www’ to a version ‘with www’ and vice versa. This of course has an effect on the page’s visibility in search results and is an ideal complement to the option of selecting a preferred domain in the Google Search Console.

Redirecting a domain from one with www to one without www:

RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

Redirecting a domain from one without www to one with www:

RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

These redirects are particularly useful for website owners who wish to have their page at one specific address, and would like to avoid unnecessary duplicate content.

Redirecting a particular subpage to another:

RedirectMatch 301 /category/file.php http://example.com

Alternatives to redirecting in the .htaccess file:

It is possible that you might not be able to edit the .htaccess file. In this case, there is another way to redirect users and Google robots to the new address:

PHP redirecting

To the index.php file, or another that is responsible for displaying content, it is necessary to add as high code as possible:

<?php
header("Location: http://example.com/index.php");
die();
?>

This will make it possible for users and Google robots to be redirected to the new address.

JavaScript redirecting

To carry out a redirect using JavaScript, all you have to do is add simple code to the page:

<script type="text/javascript">
window.location = "http://www.example.com";
</script>

How can I check which type of redirect I am dealing with?

To test the redirect method for a given page, just use a tool for ‘eavesdropping’ on the page. The simplest one to use is https://websiteadvantage.com.au/Response-Redirect-Header-Checker#heading-ToolResult. Write in the address and there are your test results.

 

At the bottom is the redirect code – in this case 301.

Information for Google robots

Redirects do not always have to be visible to users. Sometimes, it is enough to inform indexing robots that the content is available at a different address. This is an excellent solution in situations when you have the same content in several different places (even on other pages), and you want to indicate the Google the source of our content. For this, it’s worth using a canonical tag, which allows you to indicate the page containing the source of the content using the appropriate tag in the <head> part. canonical tags are a sort of redirect for indexing robots.

However, it’s worth remembering that indexing robots can take into account the rules covered by this tag but they don’t have to.

Here are some example uses of canonical tags:

The same page with a product description has dynamic URLs depending on the users' session and/or on their search preferences.

https://www.example.com/products?category=dresses&color=green

https://example.com/dresses/cocktail?gclid=ABCD

https://www.example.com/dresses/green/greendress.html

The blog system automatically saves various URLs, when you put the same post in different sections.

https://blog.example.com/dresses/green-dresses-are-awesome/

https://blog.example.com/green-things/green-dresses-are-awesome/

Your server is configured to present the same content for www subdomain pages and http protocols.

http://example.com/green-dresses

https://example.com/green-dresses

http://www.example.com/green-dresses

Content that you upload to this blog for distribution to other websites is replicated in part or in total on the other websites.

https://news.example.com/green-dresses-for-every-day-155672.html (post after distribution)

https://blog.example.com/dresses/green-dresses-are-awesome/3245/ (original post)

Source: https://support.google.com/webmasters/answer/139066?hl=en

 

What’s it best to beware of?

You need to watch out for redirects that are not really redirects. Sometimes, home-grown webmasters come up with the ‘brilliant’ idea of redirecting by uploading content of a new page to iframes. If you suspect that something’s not quite right with your redirecting, look through the page code to see if there are any frames.

Summary

Redirects are a powerful tool that is worth using from day one of having an internet page. There are rumors that redirect 301 can be used for positioning. But for more info on that, turn to your friendly link builder.

Your comments (0)
The WhitePress editors reserve the right to remove comments offensive to other people that contain vulgar words or do not relate to the subject matter of the subject matter.

The Controller of personal data of individuals using the whitepress.com website and all its subpages (hereinafter: the Service) within the meaning of Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (hereinafter: GDPR) is collectively "WhitePress" Spółka z ograniczoną odpowiedzialnością with its registered office in Bielsko-Biała at ul. Legionów 26/28, entered into the Register of Entrepreneurs of the National Court Register kept by the District Court in Bielsko-Biała, 8th Economic Division of the National Court Register under the KRS number: 0000651339, NIP: 9372667797, REGON: 243400145 and the other companies from the WhitePress Group (hereinafter together: the Controller).


By registering for the newsletter, you consent to receiving commercial information via electronic communication means, especially email, regarding direct marketing of services and products offered by WhitePress Sp. z o.o. and its trusted business partners interested in marketing their own goods or services. The legal basis for processing your personal data is given consent (Art. 6 (1) (a) GDPR).


At any time, you have the right to withdraw your consent for the processing of your personal data for marketing purposes. For more information on the processing and legal basis for processing your personal data by WhitePress Sp. z o.o., including your rights, you can find in our Privacy Policy.

Read all
  • No comments on this article yet.

The Controller of personal data of individuals using the whitepress.com website and all its subpages (hereinafter: the Service) within the meaning of Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (hereinafter: GDPR) is collectively "WhitePress" Spółka z ograniczoną odpowiedzialnością with its registered office in Bielsko-Biała at ul. Legionów 26/28, entered into the Register of Entrepreneurs of the National Court Register kept by the District Court in Bielsko-Biała, 8th Economic Division of the National Court Register under the KRS number: 0000651339, NIP: 9372667797, REGON: 243400145 and the other companies from the WhitePress Group (hereinafter together: the Controller).


By registering for the newsletter, you consent to receiving commercial information via electronic communication means, especially email, regarding direct marketing of services and products offered by WhitePress Sp. z o.o. and its trusted business partners interested in marketing their own goods or services. The legal basis for processing your personal data is given consent (Art. 6 (1) (a) GDPR). By submitting the form, you declare that you have read the Privacy Policy.


At any time, you have the right to withdraw your consent for the processing of your personal data for marketing purposes. For more information on the processing and legal basis for processing your personal data by WhitePress Sp. z o.o., including your rights, you can find in our Privacy Policy.

Read all
Recommended articles