Breadcrumb

URL Redirects

Before getting started with redirects, know the difference between a URL alias and a URL redirect in Drupal. An alias allows users to access a node or file at an alternative path. A redirect is moving a user to the correct file or node because it no longer exists at a previous path. 

How to Create a URL Redirect in Drupal

Only Site Builders have the ability to create URL redirects. If trying to create a redirect to another site and your page you are redirecting from still exists in your site, you will need to use the node path instead of its alias. 

  1. In the admin toolbar, navigate to Configuration -> Search and metadata -> URL Redirects
    Navigating to URL redirect screenshot
  2. Click "Add redirect" (if you didn't already navigate to "Add redirect".
    Add redirect button
  3. Type in the root relative path. You can type in a path that does not exist at your current location. For example, if your old website's URL no longer is valid, type in the original URL here that people are trying to get to. 
    Add URL redirect screenshot
  4. In the "To" field, start typing the title of the node/file that does exist. The system will filter for it when you start typing. 
  5. Select the Redirect Status from the options. You can find more information about HTTP redirect status codes at http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection.
    Redirect options screenshot

Domain Redirects 

In some cases, domain redirects are necessary. Domain redirects will redirect an additional domain name to your site or a specific page. 

For example, if three websites are consolidating, you may want those three domains to redirect to the new domain. 

Old sites: transportation.ucr.edu, fleet.ucr.edu, and parking.ucr.edu
Merging all to: transportation.ucr.edu 

In the new Transportation site, there is a page specifically about parking at transportation.ucr.edu/parking. The domain parking.ucr.edu is added to transportation.ucr.edu and then redirected to transportation.ucr.edu/parking.

Process for Domain Redirects

When a request for launching a Drupal site is made, please include all domains that need to be associated with the Pantheon site. If your site is already launched and you are adding a new domain, please open a Campus Web Solutions service ticket. The additional domains need to be mapped to your Pantheon site. This will need to happen BEFORE you continue to create the exact redirects. 

  1. Make sure DNS has been updated to include the needed domains (ITS Service Link request)
  2. Campus Web Solutions will then map those domains to your Pantheon site. 
  3. (This can be done before steps 1 and 2, but it will not work until 1-2 are completed.) Set up your domain redirects.
    1. In the admin toolbar, navigate to Configuration -> Search and metadata -> URL Redirects (click on URL Redirects)
    2.  Select Domain redirects in the tab bar
    3. Add domain and the destination 
      domain redirect screenshot
      In the "From domain" section, use the domains that were mapped. In the example, it would be parking.ucr.edu and fleet.ucr.edu. Add a subpath of that domain if necessary. The "Destination" will be the new page that the domain should redirect to. This will need to be the full path without "https", for example: transportation.ucr.edu/parking
    4. Click Add another for additional redirects or Save