---json
{
"canonical": ":automatic:canonical",
"name": "Automatic Canonical Path",
"page_id": "0g5ex3ct5vuzof4zo3f71"
}
---
====== Automatic Canonical Path ======
===== About =====
This feature provides a default value to the [[docs:router:router|router]] for the [[..:page:canonical|canonical path]] based on the last parts of the [[docs:page:system:path|page path]].
It allows therefore a [[docs:router:permalink#named|named permalink redirect based on the canonical]].
There is no automatic canonical created for the [[docs:theme:slot:slot|slots]] as they are not intended to be accessed directly.
===== Example =====
For example, if you have a [[docs:page:system:path|page path]] with the value
:seo:backlink
This feature will:
* not create a [[..:page:canonical|canonical]] if the [[#configuration|minimal number of name configuration]] is 0
* create a [[..:page:canonical|canonical]] of:
* ''backlink'' if the [[#configuration|minimal number of name configuration]] is 1
* ''seo:backlink'' if the [[#configuration|minimal number of name configuration]] is 2
===== Configuration =====
If the [[docs:app:configuration|configuration]] ''MinimalNamesCountForAutomaticCanonical'' has a value of:
* ''0'' disable this feature
* ''1'' will create a [[..:page:canonical|canonical]] with the first last name part
* ''2'' will create a [[..:page:canonical|canonical]] with the last two name parts
* For small website, this configuration is set to 1
* For bigger website, this configuration is set to 2
To have a value above 2 is not really common and should be avoided.