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.
- In the admin toolbar, navigate to Configuration -> Search and metadata -> URL Redirects
- Click "Add redirect" (if you didn't already navigate to "Add redirect".
- 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.
- 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.
- 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.
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 transporation.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 acsitefactory site. If your site is already launched and you are adding a new domain, please open a service ticket at Service Link. The additional domains need to be mapped to your acsitefactory site. This will need to happen BEFORE you continue to create the exact redirects.
- Make sure DNS has been updated to include the needed domains (ITS Service Link request)
- Campus Web Solutions will then map those domains to your ACSF site.
- (This can be done before steps 1 and 2, but it will not work until 1-2 are completed.) Set up your domain redirects.
- In the admin toolbar, navigate to Configuration -> Search and metadata -> URL Redirects (click on URL Redirects)
- Select Domain redirects in the tab bar
- Add domain and the destination 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
- Click Add another for additional redirects or Save