Skip to content

Clean URLs

Clean URLs

Clean, well-formed URLs are essential for improving your website's search engine optimization (SEO). They help search engines better understand the content of your pages and improve the user experience.

Install and enable Redirect module

  • Status: ✅ Completed by default
  • What's this about? Drupal CMS automatically installs and enables the Redirect module when you install the SEO Tools add-on. Redirect module helps your site automatically redirect visitors from outdated or changed URLs to their current location, preventing broken links, and helping search engines update their results.
  • Recommended for: All Drupal CMS sites
  • Terms to know:
    • Redirect: An instruction that automatically sends visitors from one URL to another. Related to a URL alias which is used to set a canonical keyword-rich URL for content. When a URL alias is updated manually, a redirect is created to the content's current alias.
  • Next step:
    • Use the provided Configure permissions link to review which user roles have permission to create redirects.

Configure the Redirect module

  • Status: Not completed by default
  • Recommended for: All Drupal CMS sites
  • Next steps:
    • Use the provided Configure link to verify or update the default settings for the Redirect module. For most sites, the default settings will be appropriate.
    • To add or manage redirects, use the administrative toolbar, go to Configuration > Search and metadata > URL redirects (admin/config/search/redirect).

Configure the Redirect 404 module

  • Status: Ongoing maintenance task.
  • What's this about? The Redirect 404 module keeps a list of "404: Not Found" URLs accessed by visitors, which you can then create redirects for or ignore. The default settings typically work well for most sites.
  • Terms to know:
    • 404 error: Occurs when a requested page cannot be found. Named for the HTTP status "404: Page Not Found".
  • Recommended for: All Drupal CMS websites
  • Next steps:
    • Use the provided Configure link to view a list of "not found" pages accessed by site visitors and add redirects where appropriate.
    • Access settings for both Redirect and Redirect 404 modules at Configuration > Search and metadata > URL redirects > Settings (admin/config/search/redirect/settings).

Install and enable Pathauto module

  • Status: ✅ Completed by default
  • What's this about? Drupal CMS includes the Pathauto module and installs it during initial setup. Pathauto generates clean and meaningful URL aliases for your content, improving readability and SEO.
  • Recommended for: All Drupal CMS sites
  • Terms to know:
    • URL alias: A SEO- and user-friendly version of a URL that's easy to read and remember. For example, /wine-tours-in-oregon as an alias of /node/42. Both URLs will point to the same page, but /wine-tours-in-oregon would be the preferred canonical URL.
  • Next step:
    • Use the provided Configure permissions link to review which user roles have permission to perform tasks related to pathauto and URL aliases.

Configure the Pathauto Module

  • Status: ✅ Completed by default
  • What's this about? A user with permission to administrate pathauto can configure how pathauto generates and updates URL aliases.
  • Recommended for: All Drupal CMS sites
  • Terms to know:
    • Transliteration: Swap letters into their phonetic equivalent in ASCII characters. URLs only support ASCII characters. Since URL aliases are based on the title of content by default, it's important that letters with accents or other non-ASCII characters be transliterated.
  • Next steps:
    • Use the provided Configure link to review Pathauto's settings. The default settings are usually adequate for most sites.

Create Pathauto patterns

  • Status: Not completed by default.
  • What's this about? All built-in content types already have URL alias patterns pre-defined. You should review the URL alias patterns before you start creating content so that your URLs are consistent, organized, and SEO-friendly.
  • Recommended for: All Drupal CMS sites
  • Terms to know:
    • Entity types: The different kinds of things your Drupal CMS site is made of. A common entity type is a content type. Since content types have dedicated pages, patterns for their URL aliases have already been set up by the system.
    • Pattern: A pattern for a URL alias can include URL-safe characters such as a slash (/), hyphen (-), letters a-z, numbers 0-9, and tokens.
    • Token: Tokens are dynamic placeholders that are replaced by entity-specific values. They are surrounded by square brackets and refer to fields on entities. For example, [node:title] is a placeholder for the title of the content.
  • Next steps:
    • Review existing patterns for built-in content types. Select Edit from the Operations dropdown to make changes.
    • For custom content types, we recommend you pick a pattern from another content type, select Duplicate from the Operations column, then edit the pattern as appropriate.

Install and enable File (Field) Paths module

  • Status: Not completed by default.
  • What's this about? File (Field) Paths module is useful if you regularly upload images or documents and need structured, consistent paths like /files/articles/[title]/image.jpg.
  • Recommended for: Special cases only
  • Next steps:
    • Download and install this module if your site requires specific paths for uploaded files, such as images or documents.

Configure File (Field) Paths module

  • Status: Not completed by default.
  • Recommended for: Sites where the File (Field) Paths module is installed
  • Next steps:
    • Use the provided Configure link to configure patterns for file field paths.