Managing URL redirects in Drupal

This article describes how to manage URL redirects in Drupal using the Redirect module. Well-configured redirects help readers find your content, and can also help search engine optimization (SEO).

This article describes how to manage redirects in Drupal. It is important to keep pages properly linked with redirects, especially on sites that have a lot of content.

Sometimes when you migrate or update a site, the new site can have URL-related issues. This article discusses how to use the Redirect module to manage URLs in Drupal. With the Redirect module, you can create manual redirects. Additionally, you can help maintain canonical URLs for all of your content, which assists in Search Engine Optimization (SEO).

Managing redirects

To manage redirects in Drupal using the Redirect module, follow these steps:

  1. Use your web browser to visit https://www.drupal.org/project/redirect, and then download the module .zip or .tar.gz file to your local computer.

    📘

    Note

    If the Redirect module is already available in your Drupal bundle, you do not need to install it and can go to step 6.

  2. Log in to Drupal as the administrator.

  3. On the top menu bar, click Extend.

  4. Click Install new module.

  5. Under Upload a module or theme archive to install, click Select, select the file you downloaded in step 1, and then click Install. Drupal adds three modules:

  • Redirect: This is the primary module for managing redirects.

  • Redirect 404: This module logs all "404 Not Found" requests and enables you to create redirects from them.

  • Redirect Domain: This module enables wildcard-based redirects, as well as domain redirects. This feature is useful when you move a site from an old domain to a new domain.

  1. On the top menu bar, click Configuration.

  2. Under SEARCH AND METADATA, click URL redirects. The Redirect page appears:
    Drupal - Redirect module main page

  3. To add a manual redirect, click Add redirect:

  • In the Path text box, type the redirect source.

  • In the To text box, type the redirect destination.

  • In the Redirect status list box, select the type of redirect.

  • Click Save.

  1. To manage "404 Not Found" redirects, click the Fix 404 pages tab.

  2. To manage domain redirects, click the Domain redirects tab.

  3. To manage general module settings, click the Settings tab:

  • Under GLOBAL REDIRECTS, select the Enforce clean and canonical URLs check box to help maintain canonical URLs for your site.

More Information

Related Articles