The Pathauto module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias. This allows you to have URL aliases like /category/my-node-title instead of /node/123. The aliases are based upon a "pattern" system that uses tokens which the administrator can change.
Requirements: Install below module also with the Pathauto module.
Follow below steps:
- Install and Enable Pathauto, Token, CTools (Chaos tools) modules.
- Configuring Pathauto, Go to Admin -> Configuration -> Search and metadata -> URL aliases ->Patterns.
- In the above image, already Pathauto pattern is created for article content type. If you add new article content type automatic generate alias is available for article content. See below image.
- After click on save, the Pathauto will generate automatic alias as per article pattern. Of course, if you want to give specific URL alias then you can uncheck the generate option and enter your own alias.
- Adding pattern for total Content – This pattern will create aliases for all the content type available. For example, Article, Blog, Note etc.
- Click on Add Pathauto pattern and select the options and enter pattern as required. I am selecting all content type and given a content label.
- After that click on Save and add contents. Now the Pathauto will generate automatic URL alias for all contents.
- For example, Path Pattern: [node:content-type]/[node:title] = Alias: article/drupal.
- After enabling and added pattern, now the path alias are automatically generated only for new content. But to change the alias for existed content we want to update alias using Bulk Generate option manually.
- Before generating you can also delete existed alias using Delete aliases option as shown in the above image. Then generate Bulk generate for existed content as shown in the below image.
- That’s it, now every content has its own aliases with node title. Also, you can add patterns for particular content, taxonomy, and page as same as the content pattern. For example, see below screenshot.