SEO friendly URLs with Pathauto

Drupal content has a default URL at /node/ID, or you can write a custom one for each page. You often want to structure your URL paths somehow, for example around your menu categories or by a taxonomy. That way, the user gets some context of where they are and can navigate to relevant parent content.

It can be tedious to implement URL patterns manually, especially if multiple people are entering content. You can use the Pathauto module to define patterns using tokens from the content being created. This lets you come up with a good structure for your site that aligns your URLs, menus, breadcrumbs, the sitemap, and other related content pathways.

Create a new pattern at /admin/config/search/path/patterns such as [node:content-type]/[node:title]. This will give you urls like /article/seo-friendly-urls-with-pathauto.

You can skip automatic URLs for pages, or create another pattern for them that's just [node:title], without the content type.

If you add Pathauto to your site after creating some content, you can bulk generate URLs according to your patterns. You can do this at any time if you want to update them.

But be careful! Changing your urls means that links that point to them from other sites will no longer be routed. This is where the Redirect module comes in. Once it's installed, changes to URL aliases will automatically be rerouted.

Tags
Routing