URL transformation rules
Before text becomes an address, generated from an object name or typed in the administration, Exponential cleans it with a transformation group of transform.ini. The group is chosen in site.ini [URLTranslator] TransformationGroup.
The three groups
The examples were produced with the shipped settings and WordSeparator=dash.
- urlalias (default): "Café & Bäckerei: Öffnungszeiten" becomes cafe-baeckerei-oeffnungszeiten. It transliterates to Latin letters (ä becomes ae), removes accents, lower case; keeps only a-z, 0-9, _, !, . and -; everything else becomes the word separator
- urlalias_iri: "Café & Bäckerei: Öffnungszeiten" becomes Café-Bäckerei-Öffnungszeiten. It keeps all characters and their case, except the reserved ones (space, tab, \ % # & ; / : = ? [ ] ( ) +, and the double quote with TrailingCleanup=enabled), which become the word separator; addresses are sent IRI-encoded (UTF-8)
- urlalias_compat: "Café & Bäckerei: Öffnungszeiten" becomes cafe_baeckerei_oeffnungszeiten. The style before eZ Publish 3.10: lower case a-z and 0-9, underscores between words
In all groups repeated separators become one, double dots are removed, and separators, dots and ! are stripped from the start and end.
Word separator
site.ini [URLTranslator] WordSeparator is dash (default), underscore or space; any other value means a dash. urlalias and urlalias_iri use it; urlalias_compat always uses underscores.
Case
urlalias and urlalias_compat make addresses lower case. urlalias_iri keeps the case of the name. Looking up an address does not depend on case.
Scripts without a transliteration table
A title in Arabic, Persian, Chinese, Japanese, Korean, Thai or Devanagari keeps no letter with urlalias. Such a title is converted with ScriptFallbackTransformationGroup instead (urlalias_iri by default), so "دليل المستخدم" becomes دليل-المستخدم rather than node_123. Leave the setting empty to turn this off.
Changing the group
A new group applies to aliases made from then on; existing aliases stay until their object is published again. To rebuild all of them at once:
php bin/php/ezcache.php --clear-tag=ini ./console exp:updateniceurls --update-nodes --allow-root-user
The old addresses stay as history entries and redirect to the new ones.
Related pages
Contributors
- Julia Shymova
- Andrea Melo Maintainer
- Geir Arne Waaler Maintainer
- STEVO Commenter
- Graham Brookins Updated Maintainer
Comments (1 historical)
Written by readers of the earlier documentation sites, kept as they were.
Filters[] is replaced in 4.3
STEVO ·
by FilterClasses[]=MyFilterClass
hope this saves someone else an hour or 2.