URL Redirects (Vanity URLs)
URL redirects allow you to temporairly change the URL that a page is accessible by. Frequently, a page is redirected to a better looking or more desirable URL, often times called a vanity URL. An example would be changing the URL to a PDF from https://nhm.org/sites/default/files/2023-03/BPX_2023_Butterfly_Guide_Digital_Spanish_FINAL_1.pdf
to https://nhm.org/butterfly-pavilion-guide-english
.
Using the URL redirect menu
The URL redirect menu is an interface where all URL redirects are stored and made accessible. The URL redirect menu is where redirects to any entity (a page, a file, a media node) can be created. Below are the steps to create a redirect via the URL redirect menu:
Navigate to URL redirect menu.
The url redirect menu is accessible via Configuration > Search and metadata > URL redirects.
Click "Add a redirect"
You should see a blue button in the top right of the page that says + Add a redirect.
Add the path you'd like the new URL to go to
In the Path box, add the path you'd like the new URL to go to. In the To box, add the page or URL of where you'd like to direct traffic to.
An example would be wanting to assign the vanity URL of nhm.org/butterfly-pavilion-guide-english
to the PDF accessible via: https://nhm.org/sites/default/files/2023-03/BPX_2023_Butterfly_Guide_Digital_Spanish_FINAL_1.pdf
.
In the Path box, you'd enter butterfly-pavilion-guide-english
.
Select the page or content in the "To" box
When you start typing in the To box, a dropdown of available nodes (i.e. pages) will appear. You can either select from the dropdown or type the full URL (including the https://
) of the content you'd like to redirect to.
To use the example above, in the To box you'd enter https://nhm.org/sites/default/files/2023-03/BPX_2023_Butterfly_Guide_Digital_Spanish_FINAL_1.pdf
.
Choose "Redirect status"
You should choose 301 Moved Permanently
unless told otherwise.
Click "Save" button
After you've saved your new URL redirect, it can take a few a hours for it to take into effect.