i

Buy a domain and host your business online free for 3 months. **

Claim offer
.com
$ 5.99 $ 26.99 /1st year
.one
$ 1.99 $ 16.99 /1st year

Log in

Control Panel Webmail Website Builder Online Shop File Manager WordPress

What is a 301 redirect?

Read what a 301 redirect is and how to create one for your website

When you run a website, you come across technical terms. Including ‘301 redirect’. This term means you redirect traffic to another web page. What is that exactly? And how do you create a 301 redirect? You will find the answer to these and other questions in this article.

vector

Brief Summary

Glossary

A 301 redirect is a permanent redirect from one URL to another URL. You redirect visitors and search engines without sacrificing your website’s usability and SEO value.

301 redirect meaning

A 301 redirect means you permanently redirect a URL to another URL. You automatically redirect visitors and search engines from web page A to web page B without causing them any inconvenience.

301 vs 302 redirect

Besides a 301 redirect, the 302 redirect exists. Whereas 301 is a permanent redirect, 302 is a temporary redirect. You redirect visitors and search engines for a specific time, for example, if a product is temporarily sold out. After some time, you remove the redirect to make the page accessible again.

Fact: Other redirects exist, such as 303, 307 and 308. But these are rarely used.

Building your website on ultra-fast web hosting

Make your dream a success. Host your site on fast, secure and reliable servers.

Get started
  • High-performance SSD servers
  • Easy-to-use Control Panel
  • Free website builder
  • Free SSL certificate
  • Daily backup
  • 24/7 support

Why use redirects?

Redirect is used for several reasons. The main reasons are that you improve user experience and maintain SEO value with a redirect. Below are more reasons.

  • New site structure

When creating a new site structure, such as changing URLs, ensure all links are redirected to the correct destination.

  • Fixing dead links

Do you delete a page? A 404 error will occur on a non-existing page of your website. You refer visitors and search engines to the correct page with a redirect.

  • Domain change

When you change your domain name, you need to redirect all existing pages to the new URLs. With a redirect, you take care of this.

  • Move content

Are you moving content from one page to another? You refer visitors and search engines to the new page with a redirect. Moreover, you ensure the SEO value of the pages is passed on to the new pages, so your website does not lose this.

  • Spelling error

If there is a spelling error in the URL, you can fix it by creating a new URL. You redirect the wrong URL to the correct URL.

How does a redirect work?

A redirect works simply. To best explain it to you, below are the steps that take place.

  1. A visitor enters the URL in his web browser or clicks on a link on an existing page.
  2. The server (computer) hosting the website receives the request from the browser and discovers a redirect has been set on the URL.
  3. The server sends an HTTP status code to the browser and returns the URL to which the redirect points.
  4. The browser receives the instructions from the server and displays the new URL to the visitor.

When should you use a redirect?

Several scenarios exist to consider when it makes sense to use a 301 redirect. For example, in the case of a(n):

  • Outdated news item or blog article;
  • Sold-out product that will not be replenished;
  • Expired event;
  • Page that is no longer relevant;
  • Adjustment in the site structure;
  • 404 error;
  • Domain change;
  • Spelling error in the URL.

How long does a redirect take?

A good redirect takes a fraction of a second. Indeed, visitors often do not realise they are being redirected to another page.

However, several factors can cause a redirect to take longer, such as the server speed, page size and visitor’s network connection. These factors affect the user experience. So make sure you choose fast hosting and make your website faster.

How do you create a 301 redirect?

You can create a 301 redirect in several ways. For most of them, you need technical knowledge. Don’t you have this? Ask a web developer to help you. Nevertheless, we want to help you by explaining the ways below.

1. .htaccess

First, you can create a 301 redirect via your website’s .htaccess file. This is the best way. You can find the .htaccess file at one.com via the File Manager of your Control Panel. Add the following code as a separate line in the file:

Redirect 301 /old-page.html https://www.yourdomainname.com/new-page.html

Replace ‘/old-page.html’ with the current page without ‘www.yourdomainname.com’. For ‘https://www.yourdomainname/new-page.html’, use the full URL to which the old page should point. Finally, don’t forget to save the .htaccess file.

2. HTML

You can also create a 301 redirect in HTML. You place the code in the header file between the lines and . Only adding a redirect in HTML code is not recommended. Not all web browsers respond to a redirect in HTML. Also, some search engines do not pass on the SEO value of the old page to the new page.

Do you still want to create a redirect 301 in HTML? You will need the following code:

<meta http-equiv="refresh" content="0;URL='http://www.yourdomainname.com/new-url.html'" />

Replace ‘http://www.yourdomainname/new-url.html’ with the full URL you want to point to the old page.

3. PHP

Do you want to set up a 301 redirect via PHP? In this case, you need to put the code below at the top of the PHP file:

<?php
header("Location: http://www.yourdomainname.com/new-page.php");
Exit;
?>

Replace ‘http://www.yourdomainname.com/new-page.php’ with the full URL you want to link to.

4. JavaScript

Using JavaScript, it is also possible to set up a redirect. Adding a redirect in JavaScript is also not recommended because the HTTP status code is missing, and search engines react differently to this redirect.

You can use the following code to set up a 301 redirect in JavaScript:

window.location.href = "http://www.yourdomainname.com/new-page.html";

Replace ‘http://www.yourdomainname.com/new-page.html’ with the full URL you want to link to.

5. WordPress

Do you have WordPress? You can use a WordPress plugin. The Redirection plugin makes it easy to create 301 redirects.

In the screenshot above, you can see the following features:

  • Source URL: Paste the old URL here.
  • Query Parameters: You can leave this as is.
  • Target URL: Paste the URL you want to point to here.
  • Group: Select the group under which the redirect falls.
  • Add redirect: Add the redirect with 1 click.

301 redirect checker

After setting up a redirect 301, it is essential to check that the redirect works. This will prevent your website from not working correctly. You check a redirect via a 301 redirect checker. For example, via whatsmydns.net or redirect-checker.org. Is the redirect broken? Check whether the settings are correct.

In brief

A redirect 301 is a permanent reference from one URL to another URL. You ensure visitors and search engines are successfully redirected from pages A to B. For example, if the page no longer exists. In this article, you have gained knowledge about 301 redirects. You know why it is essential to set up a redirect and during which situations a redirect is desired. You also learned how to set up a 301 redirect in different ways so that you can get started yourself. Good luck!

Building your website on ultra-fast web hosting

Make your dream a success. Host your site on fast, secure and reliable servers.

Get started
  • High-performance SSD servers
  • Easy-to-use Control Panel
  • Free website builder
  • Free SSL certificate
  • Daily backup
  • 24/7 support