Roberts

Set up URL redirect

2 min read

To access Redirect configuration, go to Configuration -> Search and metadata -> URL redirects.

Redirections page has a number of tools to manage the list, including filtering, edit/delete and bulk delete operations. Editing and adding a new redirection will open the same editing form.

To add a new redirect click Add redirect
 

redirect
Fig 1
redirect
Fig 2. Add/edit redirect form

Two general types of redirections can be setup:

  • Redirection from a path/url of an existing Drupal page, associated with that path/url
  • Redirection from a path/url of a nonexisting Drupal page

 

Redirection from a path/url of an existing Drupal page

In order to redirect from an existing Drupal page, we need to provide a 'base' page url into the 'path' field.

Let's say we want to redirect /example-product to /new-example-product

  1. To do this we need to get a node ID number of the /example-product. Read here on how to obtain that ID.
  2. Then enter the url with the Node ID, such as node/ID (without forward slash), and select page to redirect to.

Redirection from a path/url of a non existing Drupal page

If a Drupal page does not exist (was either never created or was previously removed) there is no node ID associated with such page. Hence we need to enter an actual URL into the Path field, see image Fig 5.

Redirect 'to'

Select the page to redirect to.

  • If the redirect leads to internal page start typing the title of a page in To field (it's an autocomplete field and should list the pages matching the search). 
  • You can also enter an internal path manually, for example /support/contact-us or /new-example-product (notice the preceding forward slash at the start).
  • Enter <front> to link to the front page.
  • Enter <nolink> to display link text only. 
  • Alternatively, enter external URL such as http://example.com

 

Redirect status

Select the redirect status. You can find more info about HTTP redirect statuses at http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection

 

Language

You can specify the language version of the page the redirect should be active for. Select All languages to active it for all language versions of the page

redirect
Fig 3. Redirecting an existing page to internal page
redirect
Fig 4. Redirecting an existing page to external URL
Redirect
Fig 5. Redirecting from an URL (when the page itself does not exist on Drupal)