Configure Pathauto to work with language-specific path aliases

To configure Pathauto to have language-specific path aliases, do the following:

  1. admin/build/modules: enable Locale and Content Translation modules
  2. admin/build/block: enable the language switcher block (this is required since your path aliases will only show in the currently active language, the rest will show as unaliased)
  3. admin/settings/language/add: add a couple of new languages - say French and Spanish
  4. admin/settings/language/configure: change the 'Language negotiation' setting to 'Path prefix with language fallback'
  5. admin/content/types: edit the content types that require translation and set the 'Multilingual support' setting to 'Enabled, with translation' - the setting is in the 'Workflow settings' fieldset
  6. admin/build/path/pathauto: add new, language-specific patterns for the node types, say article/[title-raw] for French and artículo/[title-raw] for Spanish
  7. node/add/story: create a new item of content, and set the language to English (or whatever your default language is)
  8. node/NID/translate: click the Translate tab and then click the 'add translation' link for each language that you wish to have a translation

Pathauto Patterns that can be Dangerous

Certain patterns can be harmful or dangerous for your site.

Aliases that begin at the root

If you have an alias such as [title-raw] for a piece of content that users can create you allow them to create pages like "http://www.example.com/google1234567.html" that are used to authenticate Google or Yahoo! webmaster tools. This then allows the user to authenticate as the owner of the site and control the entries inside those tools (including removing your site from the index, changing between www and no-www versions of your site, telling the search bot to visit less frequently). This is not the default and is not recommended. If you want short aliases at a minimum make your pattern something like "c/[title-raw]" to put a character "c" before every title.

Index Aliases

For example, certain situations where you create a pattern like forum/[title] and you have "Create Index Aliases" turned on pathauto will then create a page at example.com/forum/ which over-rides the default example.com/forum page. In order to fix this problem you can clear out that entry from the url aliases either via the GUI at example.com/admin/path or via the database table. A better path to create would be forums/ or discussions/ so that the names don't collide.

Transliteration Problems

Pathauto: generate URL path aliases automatically

The Pathauto module creates automatic path aliases for content, users, and taxonomy terms, eliminating the need to create them manually. This way, your site is more user and search engine friendly, and more descriptive about its content with less work from your side.

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.

The aliases are generated when you create content in your site and are based upon the pathauto patterns (placeholders) you specify at:

  1. For 6.x :  Administer > Site Building > URL aliases , in the "Automated alias settings" tab.
  2. For 7.x, 8.x :  Administer > Configuration > Search and Metadata > URL aliases , in the "Patterns" tab.
Subscribe with RSS Subscribe to RSS - path aliases