Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

The Pathauto Module

Parent Feed: 
easy pathauto module install and configuration

 

https://www.drupal.org/project/pathauto

The Ctools and Token modules are required:
https://www.drupal.org/project/ctools
https://www.drupal.org/project/token

Credits & Thanks

Thank you to:

About the Pathauto Module

The Pathauto module generates URLs for your content without requiring you to enter the path alias manually. In other words, if the title of your new blog post is “My Big Cat” then Pathauto will set the URL to

yourDrupal8site.dev/my-big-cat

instead of

yourDrupal8site.dev/node/23.

Putting the right words in the URL is great for SEO, so this module is essential to your project. If you don’t use the Pathauto module, you must remember to create every single content URL on your website manually.

Install and Enable the Pathauto Module

WARNING:
If you have an existing site with the Pathauto module installed and enabled, before making any setting changes, you’ll want to check with your developer and content creators to make sure that any existing paths do not get changed, which can create problems with your SEO.

  1. Install the Pathauto module and the required Chaos Tools and Token modules on your server. (See this section for more instructions on installing modules.)
     
  2. Go to the Extend page: Click Manage > Extend (Coffee: “extend”) or visit https:///admin/modules.

    Drupal Pathauto Installation
     

  3. Select the checkbox next to Pathauto and click the Install button at the bottom of the page.

    NOTE: You may get a message asking for your permission to install the Chaos Tools and Token modules. If you do, click the Continue button.

    Drupal Chaos Tools Module Installation

Permissions

If necessary, give yourself permissions to use the Pathauto module.

  1. Click Manage > People > Permissions (Coffee: “permissions”) or visit https:///admin/people/permissions.

    pathauto permissions screen
     

  2. Select the appropriate checkboxes for:
    • “Administer pathauto”
    • “Notify of Path Changes”
       
  3. Click the Save permissions button at the bottom of the page.

Configure the Pathauto module

The Pathauto module adds four tabs to the URL aliases admin page. They are Patterns, Settings, Bulk generate, and Delete aliases. We only discuss Patterns and Settings in this book:

pathauto installs these tabs
  1. Go to the Pathauto admin page (Coffee: “URL aliases”), visit https:///admin/config/search/path/patterns, or:
     
    1. Click Manage > Extend.
    2. Search for Pathauto from the module list.
    3. Expand the Pathauto module section by clicking on the down arrow in the description:

      pathauto configuration link
       

    4. Click on the Configure link within the expanded description area.
       
  2. Click on the Settings tab.
     
  3. Scroll down to the Update action section and select Create a new alias. Delete the old alias This will ensure that when titles get changed, the URL will change accordingly.
     
  4. Select the Reduce strings to letters and numbers checkbox. While not necessary, if you tend to use punctuation or special characters in your blog and page titles, it’s best to make sure they get changed to something more basic and easily readable.
     
  5. If you changed anything, make sure to click the Save configuration button at the bottom of the page.
     
  6. WAIT! You aren’t done -- Scroll back down to the Update action section and click on the Redirect module settings link or visit https:///admin/config/search/redirect/settings.
     redirect module settings link within pathauto
  7. Make sure your settings match those in the box below:redirect module settings screenswhot
    • Select the Automatically create redirects when URL aliases are changed checkbox.
    • Select the Retain query string through redirect checkbox.
    • Set Default redirect status to “301 Moved Permanently”.
       
  8. After any changes, be sure to click the Save configuration button at the bottom of the page.

NOTE: We’ll investigate the rest of the Pathauto module settings in the next section.

Did you like this walkthrough? Please tell your friends about it!

facebook icon twitter social icon linkedin social icon

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web