A URL redirect will automatically send a user from one URL to another URL.

Overview

Redirects can be useful if you have:

  • changed the URL of a web page or site
  • deleted content
  • moved or merged content.

By redirecting the old URL to the new URL, you will prevent links from breaking if they haven't been updated.

Best practice

  • Redirects should be temporary – don't use them long term.
  • Links with old URLs should be updated as soon as possible, so the redirects can be removed.
  • Don't create redirect loops, where link A redirects to link B which redirects back to link A.
  • Don't create redirect chains, where one redirect goes to another redirect, which goes to another redirect and so on. Redirect chains can break browsers – review and simplify any chains with 4 or more hops.
Top of page

Creating and managing redirects

Drupal automatically creates redirects for content types (or node pages) when their URL changes. A URL might change if you alter the page title or if you move a page to a different section of the site.

If you're a site coordinator and or site builder, you can create and manage redirects for Drupal pages and files on your site.

Manage redirects

To view a list of redirects on your site, go to your site's Drupal 'Configuration' menu and then select 'Search and metadata' > 'URL redirects'. You can then edit or delete existing redirects.

Create redirects

To create a redirect:

  1. Hover over the Drupal 'Configuration' menu and go to 'Search and metadata' > 'URL redirects' > 'Add redirect'.
  2. Enter the path you are redirecting from and the path you are redirecting to. For redirects within your site, use a relative path. To redirect to an external URL, use the absolute path.
  3. Click 'Save'.

By default Drupal will create a '301 redirect', a command that tells search engines the change is permanent and they should update their listings.

In most cases you won't need anything other than a 301 redirect. If you need a different type of redirect, click 'Advanced options' on the 'URL redirects' page to view other types of redirects.

Top of page

Fixing redirect loops

If you don't manage your content carefully, you might accidentally create an endless redirect loop. Your users will then see an error message instead of the page.

A redirect loop is created when link A redirects to link B which then redirects back to link A. This can happen in error, or when a page URL is changed and then changed back to its original URL.

While Drupal automatically creates a redirect each time you change a page name, it won't automatically remove these redirects if you decide to change the page name back. This results in the original URL being redirected to a new URL, and then the new URL being redirected back to the original URL.

If you are editing an existing redirect, Drupal will warn you if the change will create a redirect loop.

How to fix a redirect loop

  1. Click the grey Drupal 'Edit' button on the page stuck in a redirect loop.
  2. Scroll to the bottom of the edit screen and click the 'URL redirects' tab at the bottom of the screen.
  3. Locate the redirect that matches the page's current URL. It will usually have a high count number.
  4. Delete the redirect.
Top of page