Skip to main content

URL Aliases and Redirects

The site provides advanced tools for the handling of the URLs the site uses for content. This includes automatically creating URL paths, and URL Redirects as needed. While these are configured to work automatically the site also provides tools for reporting and manually overriding both the Aliases and Redirects.

A URL alias is the section of the page path after the sites domain. i.e. https://www.example.com/this/is/the/alias This alias works best when it is human readable, as such Drupal will automatically create and help you manage those paths. By default Drupal uses its own internal URL for all content such as https://www.example.com/node/3 would take you to the 3rd node created on the site. However since automatic URL Aliases are enabled it would show in the browser as https://www.example.com/this/cool-page You can see what Aliases are being used at Configuration > Search and metadata > URL aliases (/admin/config/search/path).

Automatic URL Aliases are generated using token patterns. These patterns take information supplied by the content, manipulate it for browser compatibility, and then tie it together. So for instance on the Basic page, which uses the pattern [node:menu-parents]/[node:title], would create an alias like. /menu-parent-page/my-page Note that the site will do its best to both clean and transliterate the characters supplied to it. For instance it will remove special characters, and replace spaces with a - (dash). It will also transliterate the URL so that any special characters will be transliterated into the US-ASCII alphabet.

The URL Aliases are created when content is created, and updated when the content is updated. The site will intelligently manage the URL Aliases for you, including deleting changed aliases. When a page alias is changed, a redirect is automatically created so users visiting the old alias will be redirected to the new one. See below for more detail. You can manage the URL Aliases in one of two ways; on the content editor form (preferred method) or using the URL Alias table. Generally speaking you should not need to use the table as the content edit forms will let you manage the content's own alias and redirects directly. However, sometimes you will need to either search for or fix a broken alias manually.

Content URL Alias settings are found in the content configuration section on the content edit page. Click the URL alias toggle to see the settings for this content's URL Aliases. By default all content will have automatic patterns created and enabled. In order for the site to more intelligently manage the aliases and redirects, this setting should only be disabled if:

  1. You cannot get the URL alias you desire using the content provided by the URL Alias tokens. For instance by updating the content's place in the menu or changing its Title.
  2. The URL Alias needs to be different that the content Title. For example, if you want the alias for your About Us page to only read /about.
  3. You understand that manually controlling this will prevent any automatic updates to aliases for this piece of content. The site will no longer handle the automatic updating of the alias, and all changes will need to be done manually.

Additional management can be done on the URL aliases table. This table lets you search for, edit and add URL Aliases.

URL Redirects

The site is also setup to handle the automatic creating and management of content redirects; this can be managed in Configuration > Search and metadata > URL Redirect (/admin/config/search/redirect) Much like the URL Aliases the site will use the path portion of a URL and then redirect to an internal Drupal path if possible. These Redirects are automatically created when a content's URL Aliases field is changed. So that if you change your About Us page to About, the /about-us url alias would change to /about and a redirect for /about-us would go to that content. It will also intelligently watch for circular redirects and delete them. So for instance, if you changed the About page back to About Us then there would be 2 redirects pointing to each other. It will remove the original redirect so that only /about would redirect to the content.

While the Redirects are automatically created and deleted, you can still manually manage them, too. Like the URL Aliases this can be done either directly on the content Edit page, or using the Redirect table. One final note on managing the site Redirects. The Redirect section also provides a handy table for reviewing and managing page 404 errors by creating Redirects. See the Configuration > Search and metadata > URL Redirects > Fix 404 pages (/admin/config/search/redirect/404) table for a list of 404 paths that need to either be fixed or have a Redirect.