I moved five times in the last year. And every time I moved I forgot to log in to forward my mail to my new address.

Email routing is an important step in any relocation process because it ensures that you don't lose valuable information that is sent to you.

The same goes for your website: when you move a website from one URL to another, you have to take the necessary steps to ensure that your visitors are sent to the right place. In the world of technology, this is referred to as 301 forwarding.

Here we will discuss what a 301 redirect is and when you need to use one and how to redirect a URL in HubSpot or WordPress. We will also examine the differences between a 301 and a 302 redirect.

Let's dive in

What is a 301 redirect?

301 is a status code that a server sends to your browser. This is one of many possible status codes that you've probably heard of (including 404 – Not Found, 403 – Prohibited, and 500 – Server Errors). When you visit a website and the server sends the page normally, the status code attached to that page is 200 – OK.

You can think of 301 forwarding as mail forwarding. Once you've removed content from a particular URL, anyone trying to visit it will receive a 404 page message that was not found.

To improve the user experience, you can use 301 redirection to request the server to redirect visits from the old URL to a new location – the new home of your content.

If you now try to visit the old URL, the server will send the status code 301 – permanently moved back and then redirect you to the new location.

This happens so quickly that you are usually not aware of it and are simply on the content you were looking for. You may find that the URL is different from the URL you clicked or typed. Or you have a browser extension like Ayima Redirect Path that lets you know when you were redirected.

The other key role that 301 redirect performs is search engines. With useful status codes that correctly indicate where content has been moved, search engines like Google and Bing can keep their index up to date.

Essentially, a 301 redirect will tell search engines, "Hey, do you know the content that users liked to click on from the SERPs? Well, it's here now, so take all the visibility you have associated with this page and transfer it to this new URL. "

For this reason, 301 redirects are important for SEO.

Now that we've dealt with it, let's look at how you can do a 301 redirect for yourself.

How to perform 301 redirection

The actual process of implementing 301 redirection varies from CMS to CMS and from platform to platform. We can't discuss the specifics of each CMS platform, but we can take a closer look at HubSpot and WordPress. Hopefully, these instructions should help you get started, regardless of the CMS you are using.

How to redirect a URL to HubSpot

1. To set up redirection in HubSpot, navigate to the settings (with the gear on the top right)> Domains and URLs > URL redirects.

2. Select "Add URL redirection" here. The interface looks like this:

We'll go through some use cases later, but now let's look at the options here.

default

In most cases, you want to implement a single page-to-page redirection. In this case, select "Standard". Next, you want to add the original URL and the redirect URL – for your old and new URL, respectively.

You can click "Add URL Redirect" and the redirect will be added to HubSpot.

At this point, we always recommend testing your redirect. Wait a few minutes for the change to take effect on the server. Next, try going to the original URL in an incognito browser window and checking if it works as expected.

Flexible

In some cases, creating individual page-to-page redirects is very inefficient. For example, if you just moved an entire content folder, there may be 15 pages in a subfolder that you need to redirect now. In such cases, it is better to use flexible redirection.

You can think of flexible forwarding as a formula or rule. This allows you to redirect everything in a specific folder to another folder while the rest of the URL remains the same.

When you select Flexible Redirect, HubSpot automatically provides you with a link to the Flexible URL Pattern Redirection help page, which provides specific instructions on how to use the syntax for this function.

More options

Under Additional Options, HubSpot offers various extended versions of these types of forwarding. Instead, you can provide a temporary 302 redirect, choose the order in which HubSpot will go through the redirection rules when resolving a URL (which may change which valid rule fires), disable redirection if there is content under the URL, and keep the query strings, force HTTPS, and force trailing slashes at the end of all URLs.

How to redirect a URL in WordPress

If you're not a HubSpot customer, you'll need to use 301 redirects differently. WordPress is the most popular CMS in the world, so it makes sense for us to go into how to next look at redirects in a WordPress context.

However, it is important to note that WordPress itself is very flexible. WordPress installations can be very different. Therefore, we cannot provide uniform instructions, as was the case with the HubSpot CMS.

If in doubt, you should consult your web developer if you want to add URL redirects.

1. Apply redirection through the server itself.

The best way to apply redirects from a speed and technical perspective is actually through the server itself, rather than relying on WordPress. WordPress does not offer a way to implement 301 redirects immediately, although there are numerous plugins available that allow you to access this functionality.

If you use 301 redirects through the server itself, it depends heavily on the software stack that your server uses. You may be using Apache, Nginx, IIS, or any other platform that needs to be approached differently. This can also vary depending on your hosting provider.

If you don't know how to use server redirection itself, we don't recommend messing around with it as this may disrupt service to your website. Instead, we recommend that you consult with your IT team or web development partner.

2. Redirect a URL using a free WordPress plugin.

Sometimes in marketing you have to compromise the optimal solution for the solution that you can actually achieve. This can be one of these cases. If for some reason you can't implement redirection through your server, you can use a WordPress plugin.

This is not the best method. Plugins are slower and you have to rely on third-party code. Therefore, continue at your own risk.

Image source

Each interface is different, so you need to consult the help documentation of a third-party plugin for specific instructions.

When is 301 redirection used versus 302 redirection?

In general, you should expect 301 redirects.

However, there are a few cases where you want to use a 302 instead, including:

  • You may be using a gradual website launch plan.
  • You may redirect users as part of functions that do not apply to SEO, such as: B. Login gateways or e-commerce cash registers.
  • You may be using a temporary retention page and do not want to confuse search engines or damage your search engine rankings by signaling that you are permanently redirecting your detailed, extensive content to an empty retention page.

Redirect 301 use cases

Here are some special cases where you want to use the 301 redirect as a tool.

1. Change a URL.

Your original URL may have been poorly optimized, or you may be reorganizing the folder structure of your website URLs.

Moving content in HubSpot CMS is very easy. Simply change the URL on the "Settings" tab of the content editing page, and HubSpot will automatically add a URL redirect for you. Make sure that this works before proceeding.

2. Creation of new content.

Sometimes you may want to completely re-create your old content on a completely new page – for example, if you want to use a different website template.

In this case, you should make sure that you have implemented a simple 301 redirect from the old URL to your new URL. Once this is done, you will need to unpublish and archive the old page.

If you run many of them, we recommend using a flexible rule or, if a flexible rule is not appropriate, using a tool such as Screaming Frog SEO Spider in conjunction with Google Sheets or Microsoft Excel to match your redirects in bulk and then to import them into HubSpot.

You can do this on the URL redirects page using the Import button:

HubSpot provides you with a sample file for structuring your redirects and a link to the help page for bulk upload redirects.

3. Consolidate multiple content.

If you've decided that multiple pieces of content overlap, compete for the same keywords, or all deal with the same topic, you may want to consolidate them. However, you don't want to lose the search engine visibility that those old pages may have reached.

After you create your new consolidated resource, you should set up a simple 301 redirect from each of the old pages to each new page.

4. Migrate content from one domain to another.

When you move your website from one domain to another, it is critical that you implement 301 redirects from your old content to your new content.

This is easy if the site moves a domain but remains the same in structure and layout. If the content changes or is restructured, it is still important that you make sensible redirect decisions that take into account your users' original intent to pass the visibility of each of your old pages on to their new colleagues.

When implementing 301-to-page redirects from one domain to another, there is a specific challenge to consider: your redirects must be served through the original URL.

For example, it makes no sense if you connected HubSpot to your new domain, but not to your old domain, so that you host the 301 redirects for your old domain on HubSpot. You must work with your IT partner, web development partner, and / or HubSpot partner to ensure that the provisioning of redirects from your old domain was considered. We recommend that they remain indefinitely.

Migrate a website during a gradual web start

You may be moving your website from one domain to another as described above. However, due to project constraints, you are using a step-by-step approach. This means that you start the core websites in phase one, then a second side wave in phase two and so on.

In this case, we recommend creating a step-by-step diversion map. All URLs of your old domain should be taken into account and forwarding specified for each phase.

In the first phase, 301 redirects are expected to be implemented for all pages, which will be taken into account on the new site. You will also add 302 redirects for all other pages, usually to the homepage of the new website. This prevents users trying to visit your old domain from getting a 404 error without getting confused by search engines by suddenly redirecting your pages to seemingly irrelevant content.

When you start each phase, you should update your redirects and replace your 302s with 301s as soon as the counterpart is available.

These redirects must be re-implemented to be deployed from your old domain.

301 Redirect errors to avoid

After you understand the importance of 301 redirect, we'll review the general steps in the review process to ensure that you don't make a mistake that could negatively impact your site's SEO.

1. Set up 302 redirection between versions of your domains.

301 redirects indicate the performance of incoming links from one URL to another, and although this may not look like it, http://blog.hubspot.com and blog.hubspot.com are two different URLs. Make sure you've set up a 301 redirect from all different iterations of your brand's domain to improve your search engine results.

2. Set up 301 redirection after creating a new page.

In 2010, Toys & # 39; R Us bought the domain "toy.com" without first setting up a 301 redirect, and the SEO results of the new website decreased because they were used by Google as a brand new domain with no inbound links from the original ones Toys was crawled again & # 39; R Us Domain points to it. Make sure you set up 301 redirection before you migrate your website content so that your website doesn't lose traffic.

3. Use 302 redirection during content migration.

Use a 301 redirect to keep the incoming links and your search rankings while making changes to your domain, unless you temporarily migrate the content of your website while you update or repair your website.

4. Forwarding links to outdated content.

If you do not set up redirects from older internal links on your website (e.g. a link to your company blog on your homepage), a bad user experience will result for website visitors who click on these older, undirected links. The old internal link eventually changes to the new domain, but it may take a few seconds or a white screen may appear in the meantime.

5. Redirect a page with a different intent than the landing page.

This is a breeze when properly organized and recorded. However, make sure you redirect to the right pages. By way of illustration, you don't want to redirect a user looking for your homepage to your blog page.

If you make this transition smooth, this will contribute to the accuracy of search engine optimization and will lead to more satisfied visitors to your website.

Regardless of whether you're considering revising the entire content of a website migration or just revising some outdated websites, 301 redirects will help. When planning this new phase, you should think about including it in your project. Your SEO won't jump and website visitors will continue to find the helpful content they are looking for.

Other types of redirects

There are other types of forwarding, including:

1. 302 – Temporarily postponed

This works almost identically to a 301 redirect. In this case, however, we acknowledge that the move is temporary. This doesn't make a practical difference for a user, but for a search engine the message is clear – don't worry about the ranking of this new page as it won't be available for long. Stay with the old one, it will be back.

2. Meta Refresh or Javascript Redirects

This differs from the two previous approaches. The page is loaded normally with a 200 OK status code. A script is then executed on the page, which moves the user to another page.

There may be certain marginal cases where this is the only practical option, but in general you should avoid this approach. It's not associated with SEO best practices and can often provide a confusing user experience.

Fix internal 404 errors

Your SEO or web team may have identified some broken links on your website. In this case, it's a good idea to create a 301 redirect to redirect users from the broken URL to a suitable resource – one that basically matches the expected content.

However, you should also try to update the broken hyperlinks to point to the new URL. A website based on 301 redirects for internal navigation is not a best practice.

Fix 404 errors reported in Google Search Console

Sometimes the Google Search Console shows 404 pages that you don't even link to internally. So where do they come from?

The Google Search Console populates its "Coverage" section from all types of sources. Sometimes the URLs are simply the ones you saw on a previous incarnation of your website, or you may have seen an external link on another website.

If Google has seen this URL before, a user should also. You can save it as a bookmark or have it noted in an email or on a third-party website and still click on it. In this case, you want to make sure that these users get the best user experience. You should therefore try to create 301 redirects to guide these users to appropriate content that is essentially in line with the expected content.

301 redirects are critical to maintaining a healthy website. They perform a core function in signaling to users and search engines when the content of your website shifts and changes, and ensure that your user journey remains clear and logical when developing your website and that your search engine visibility is maintained from iteration to iteration.

Be sure to familiarize yourself with the method of implementing redirects in your current website environment so that you can manage them effectively.

Editor's Note: This article was originally published in December 2010 and has been updated for accuracy and completeness.

Improve your website with effective technical search engine optimization. Start by performing this audit.

LEAVE A REPLY

Please enter your comment!
Please enter your name here