How to configure automatically-generated URLs with Pathauto
If you're writing often, and don't like that you get URLs like node/42 every time you post, you can set the alias to automatically generate based on the data associated with each item, such as its title, when you posted, and what category you assigned the item to.
The Pathauto module also allows you to do "bulk" updates, that is, for content you've already entered, and can automatically alias overview pages, user profiles, category pages, and each content type that administrators enable. This module can be used in conjuction with manually setting path aliases.
We recommend that you take some thought with your URLs and try to make them readable, reliable and hackable. Check out Why you should be using disambiguated URLs for more info on good URL design.
General settings
apply to all content types as well as taxonomy URLs.
- Verbose, when checked, this means that a message will display every time you create content that has Pathauto settings, telling you that the alias has changed.
- Separator: the character that Pathauto will use to replace spaces and punctuation with.
- For example, if you have simply [title] as the Pathauto setting (see below for more), and you create an individual item with the title "The Quick Brown Fox", and the separator is a hypen ("-"), the URL alias for that item will be the-quick-brown-fox.
- Update action: tells the system what to do in the case of existing aliases.
- Do nothing, leaving the old alias intact: that means that whatever alias you used for that content will remain the same.
- Create a new alias in addition to the old alias: if you change content that already has a path alias, and the Pathauto module determines that this also means a change in automatic path alias (for example, you use [title] as the content type's setting and you change the title), it can create an alias in addition to the existing one.
- Create a new alias, replacing the old one: like above, if Pathauto makes a determination that your alias should be changed to reflect changes you've made, it will update the alias, but it will remove a previously-generated alias.
Overview Pages
Some content types have multiple page overviews of that content. The most common example is the blog type, each user with permission to have a weblog also having their own overview page. In this case, you're given settings for the overview pages.
Node path settings
Each content type with individual items can have those individual items automatically generate path aliases. The general format is as such:
- variables are surrounded by square brackets. For example, [title] will get replaced with whatever the title of your content is, also replacing spaces and punctuation with the separator you choose (see the "Separator" section above).
- static or constants - that's text not surrounded by square brackets. For example, an individual item with the Pathauto setting of journal/[title] will have the alias every item of that content type always start with "journal/" followed by the title. If you titled the item "Jumping Over the Lazy Dog" (and the separator is set to a hyphen), that item's URL alias will be journal/jumping-over-the-lazy-dog.
Some sample node path settings
Taken from Bryght Basic:
- Pattern for all Blog entry paths: blog/[user]/[title] - this allows two different bloggers to have the same title for a blog post; not a consideration if only one person is blogging on your site but a big deal for community sites with lots of bloggers
- Pattern for all Story paths: news/[yyyy]/[mm]/[dd]/[title] - this gives you a nice URL with the date which is nice to have if you are using Drupal stories for dated news and press releases
Special Cases
- [catalias]: the path alias, already-created by administrators, of the first category used for an item.
- variable names with "path" in them: if there is a hierarchy (in the cases of categories or book outlines) then that variable is replaced with the entire hierarchy, separated by "/" (forward-slash). For example if you categorize something as "Dog", which falls under the "Pets" category, which itself falls under the "Lovable Animals" top-level category, using [catpath] will automatically create an alias for the category page of lovable-animals/pets/dogs. (The example assumes a hyphen "-" separator.)