Redirects & Aliases
Summary
What is the difference between Redirects and Aliases?
- Redirect - a redirect is where you want one URL to go to another URL, essentially replacing the old URL.
- Alias - an alias is a URL which is a representation of another URL, for example a direct link to a node, and an seo friendly url.
Setting up a redirect
There may be times when you need to redirect a URL to another such as a search results page redirecting to a channel (this example is taken from the US team).
Via the content record (recommended)
You can also set up a redirect via the node edit page (for videos and channels). This is a little easier as the 'To' field
To do this:
- Edit
the video or channel.
- On the right expand the card with the heading URL Redirects
.
- Click Add URL Redirect
.
- You'll be taken to the add redirect page mentioned above, except the 'Path' field will already be completed.
Via the admin (not recommended)
To do this go to Configuration > Search and metadata > URL redirects
.
A list of existing redirects will be shown and can be edited, activated or disabled.
To add a new redirect:
- Select
Add redirect
at the top of the page. - Complete the `Path field with the URL you wish to redirect.
- Enter the URL you wish users to be redirected to into the
To
field. - Click
Save
.
Domain based redirects
These are the same as a redirect, except you can specify the domain it applies to.
To create one of these go to Configuration > Search and metadata > Domain path redirects
.
Now follow the instructions in the section above for creating a redirect via the admin.
Example
The US team use domain based redirects to send users who search for a specific term to the US channel or Canadian channel depending on which site they are on.
Setting up an alias
If you need to set up an alias follow the instructions below.
You might need to do this if a link to a node (video/channel) has been sent out via email, but a new node has been created to replace it with a slightly different URL. In which case you'd want to make the old URL and alias of the new one.
To do this go to Configuration > Search and metadata > URL aliases
.
To create a new alias:
- Select
Add Alias
at the top of the page. - Complete the
System path
with the URL where you want the alias to go. - Enter the URL you want to alias in the
URL alias
field. - Click
Save
.