Redirects

In some cases, you may need to redirect a path on your site to another page on your website or to an external website. Redirects are typically used for one of two reasons:

  1. Redirecting users from an old path that no longer exists (e.g. the page was deleted) to some other page.
  2. Creating a "shortcut" path that's easy to remember that redirects to some longer, more complex URL. For example, https://princeton.edu/service redirects to the harder to remember URL for the Service Portal https://princeton.service-now.com/service.

In the first use case, adding a redirect is important, even if you've removed references to the old path on your website. Other websites may be linking directly to that old path, and search engines like Google have likely indexed the old path as well. Redirects ensure users don't receive a "not found" error page.

Automatically Created Redirects

If the path for an existing content item (Page, News, etc) is updated, a redirect is automatically added from the old path to the new one. This allows you to make changes to the path of pages without having to remember to add the redirects.

You can see the list of redirects associated with a content item by editing it and looking at the "URL redirects" section on the form. After updating the path for a content item and saving, the automatically created redirect will appear here.

The "URL redirects" section of the content item edit form, showing two existing redirects in a list.

Manually Adding and Managing Redirects

Adding a redirect manually for an existing page can be done easily by editing the page, expanding the "URL redirects" section in the sidebar, and clicking Add URL redirect (see screenshot above).

Additionally, redirects can be added and existing redirects managed by visiting Configuration > Search and metadata > URL redirects in the admin toolbar.

Caveats

You cannot add a redirect for a path that already exists on your site. For example, if you have a page with path /some-path, you cannot add a redirect from /some-path to another page. The redirect will not work. The page you are redirecting from must not exist for the redirect to take effect.

A workaround for this is to use the system path for the page instead of the alias as the path you are redirecting from. For example, using /node/123 instead of /some-path. This is not recommended though, as it may confuse editors of the site as the page will still show up on the content dashboard but cannot be viewed directly.