Credits & Thanks
Thank you to:
- Mike Ryan (mikeryan) for creating this module
- Sascha Grossenbacher (Berdir)
- Dave Reid
- The large number of other contributors to this module!
About the Pathauto Module
The Drupal 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
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
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.
- Install the Pathauto module and the required Chaos Tools and Token modules on your server. (See this section for more instructions on installing modules.)
- Go to the Extend page: Click Extend (Coffee: “extend”) or visit https://<yourDrupalSite.dev>/admin/modules.
- 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.
If necessary, give yourself permissions to use the Pathauto module.
- Click People > Permissions (Coffee: “permissions”) or visit https://<yourDrupalSite.dev>/admin/people/permissions.
- Select the appropriate checkboxes for:
- “Administer pathauto”
- “Notify of Path Changes”
- 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:
- Go to the Pathauto admin page (Coffee: “URL aliases”), visit https://<yourDrupalSite.dev>/admin/config/search/path/patterns, or:
- Click Extend.
- Search for Pathauto from the module list.
- Expand the Pathauto module section by clicking on the down arrow in the description:
- Click on the Configure link within the expanded description area.
- Click on the Settings tab.
- 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.
- 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.
- If you changed anything, make sure to click the Save configuration button at the bottom of the page.
- WAIT! You aren’t done -- Scroll back down to the Update action section and click on the Redirect module settings link or visit https://<yourDrupalSite.dev>/admin/config/search/redirect/settings.
- Make sure your settings match those in the box below:
- 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”.
- 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!