Skip to main content
Image
Material-Design-Dark-Best-Wallpaper-23171_0.png

How Redirect Module Saves Your Organic Traffic From URL Break?

article publisher

Gaurav

Drupal

Redirect? What Is It?

Let's say you are migrating from one technology platform to another (say from WordPress to Drupal), the URL of your website is completely changed. Since you are now following a new URL pattern you don't want your users to visit the old pages. But every visitor counts. You don't want any user to leave your website, not because of a 404 Error atleast. 

What do you do? How do you save your organic traffic without disappointing your users?

To save your traffic and reputation you need to always give your visitors what they are seeking. In this case (shift from one technology platform to another) you only need to add one thing and that is to opt for a redirect. 

Redirect is the technique where you direct your users from one URL to another. In this article, we will learn how to install, configure, and work with different re-direct modules available in Drupal. 

Installing The Redirect Module

Step 1: Download the tar.gz or .zip file of redirect module from Drupal.org.

Download it as per the version (of Drupal) installed on your system.

Step 2: Go to the admin/module, by clicking on the Extend. And then click on install new module. Select the file which you have downloaded. And click install.

Extent → Install New Module  Choose File → Install 

Your redirect module has been installed. Now we have to enable it. Click on enable the newly added module.
Find out the redirect module in the list and select the checkbox and Click Install 

selecting all the redirect features for the redirect module

You may also install and enable the module using the Drush command.

Installation using the Drush command:

$ drush dl redirect    //Downloading

To enable the downloaded module, write the following command :

$ drush en redirect    ////Enable the redirect module

You have successfully enabled the redirect module.

Configuration Procedure:

To configure the redirect go to configuration and find URL redirects. Click on URL redirects.

Configuration  URL redirects  +add redirect.

Your page should look something like the image below:

re direct configurations for the admin

When you click on +Add redirect, you will come across the page where you have to fill the URL name from where you want to redirect and the final URL destination where it should go. It will also ask you to choose the redirect status. Following are some of the redirect status: 

  • 300 Multiple Choices
  • 301 Moved Permanently
  • 302 Found
  • 303 See Others
  • 304 Not Modified
  • 305 Use Proxy
  • 307 Temporary Redirects

As an example, we will here test the webpage. The image below is the image prior to re-directs. 

admin view for a drupal website

To redirect the URL, we will change the URL redirect configuration as:

adding URL redirect to the website

Here we redirected the path from - http://localhost/drupal/lal_quila - to - https://en.wikipedia.org/wiki/Red_Fort. The redirect status was selected as “301: Moved Permanently”.

Once it is successful, any user trying to access the URL for the lal_quila will be redirected to the Wikipedia page.

A Word of Caution

Whenever you are using redirects, you must keep certain things in mind:

  1. Once redirected, the final link should not redirect to another link. 
     
  2. For the inactive campaigns, you should have to use 302-redirects.
    Redirect 301 should only be used when shifting permanently from one URL to another.
     
  3. Don't shift to a new URL without first setting up a 301 redirect.


When Should You Use Redirects? 

  1. When you are looking for a change in the domain technology. 
  2. When you want to remove the pages. You redirect the page to a similar page. 
  3. When you are shifting your content from one URL to another. 
  4. To re-direct traffic from other URLs owned by the same organization. 


What Are The Types Of Redirects

There are two types of redirects:

1. Server Side Redirects
In the server side redirects, HTTP status codes are used. Some of these are: 

  • One of the server side redirects is ‘301 Moved Permanently’
  • 302 codes can be used for  -Found / Moved temporarily
  • To see the other URL And 303 can be used
  • 307 can be used for the temporarily redirects
  • 308 can be used for Permanent Redirects

2. Client-Side Redirects

It happens in the visitor’s browser. When a visitor searches for some webpage and the browser takes them to another webpage.

Meta refresh and JavaScript redirect

This element is used to tell the browser as to refresh the current page and load another URL.

For example: 

<meta HTTP-equiv=”refresh” content=”0; url=http://otherurl.com/other-url”>

This is to give the instructions to the browser, so the user is redirected only the mentioned URL and not taken anywhere else. This is called the JavaScript redirect.


What Are The Best Practices For Redirection To Save The Organic Traffic?

Whenever you can, you must avoid using redirection. Following are just some of the best practices when using redirect module.

  • If you are going to use 301 redirects to configure your web server then your preferred URL will be served to you. And the best Example for this is Trailing Slash and Subdomain.You must avoid chained redirects.
     
  • Your redirections should be of the preferred version as of your website URL.
     
  • It will be important to choose the preferred version for your site. If you are using the preferred version consistently for your website URL, then it prevents unnecessary redirects.
     
  • For inactive campaign URLs use 302 redirects.
     
  • In case you have any inactive URL - implying the ones which are not currently active - then it is suggested you use 302 redirects.
    But when your inactive URLs will be online then this code will bring you back.
     
  • Use 301 redirects for campaign URLs that will be moved permanently
     
  • To save your organic traffic you should have to create a comprehensive 301 URL redirect mapping strategy 

 Website Migration

Following are some of the reasons for website migration:

  • Switching to ((https:/))/
  • Going international
  • Rebranding
  • Planning the migration

Key points that should be considered during the Website Migration:

  • Complete your moves before canceling.
  • Do not cancel any existing web hosting plan before the move is complete.
  • Make sure that the database is working properly.

301 redirect is not only search engine–friendly but also saves your reputation.To save your organic traffic due to URL breaks you should have to keep the above point in the mind when you are using a redirect.

Subscribe

Ready to start your digital transformation journey with us?

Related Blogs

SDC: Integrating Storybook & Single Directory Component

Integrating SDC With Storybook OpenSense Labs

Today, we will talk about about Drupal Single Directory Components or SDC and Storybook. Single Directory Components in Drupal allows you…

RFP: How To Create An RFP For Open Source Solutions?

RFP OpenSense Labs

A good Request for Proposals (RFP) or Call for Proposals (CFP) clearly states the goals and expectations of your project and sets the…

Drupal 7 End Of Life: Top Reasons You Should Migrate To Drupal 10

Drupal 7 End Of Life Cover Image OpenSense Labs

Drupal 10 was released in December 2022 and ever since, the community has been pushing its users to do Drupal 7 to 10 migration. As per…