---json
{
"canonical": ":page:url",
"name": "Page Url",
"page_id": "kxbb9fdvvqm6mm8sjw5oi",
"slug": ":canonical-url"
}
---
====== Page URL (canonical URL) ======
===== About =====
The ''page url'' is the unique official URL of a page and is also known in the [[docs:seo:seo|SEO world]] as the ''canonical url''.
===== Canonical =====
This url:
* is created via the [[docs:content:link|link component]]
* is in the [[docs:seo:sitemap|sitemap]]
* is used when users bookmark your pages.
* shows in
* [[docs:seo:serp|Search Engine Result Pages]]
* [[docs:social:social|Social network Cards]]
* helps [[docs:seo:seo|Search Crawler]] to detect duplicate pages
* is the target url of [[docs:router:redirection|every redirection]]
===== Permanent =====
When you choose a permanent [[#type|url type]], ComboStrap will add a short page identifier based on the [[docs:page:page_id|page id]] at the end.
Even if you change the type or content of the URL, the [[docs:router:router|router]] will always be able to find the page.
The syntax is:
* With a [[docs:admin:nice-url|Nice Url]]:
https://domain.com/a-description/or-path-that-is-not-relevant-pageIdentifier
* Otherwise:
https://domain.com/doku.php?id=a-description:or-path-that-is-not-relevant-pageIdentifier
===== Example =====
This page has the slug ''$slug'' and has the permanent url: [[$path|$url]]
===== Type =====
The page URL may get the following format:
^ Type ^ URL Path ^ Permanent ^ Default ^
| ''page path'' | the [[docs:page:system:path|page path]] | No | Na |
| ''permanent page path'' | the [[docs:page:system:path|page path]] and the short page identifier | Yes | Na |
| ''canonical path'' | the [[docs:page:canonical|canonical path]] | No | ''page path'' |
| ''permanent canonical path'' | the [[docs:page:canonical|canonical path]] and the short page identifier | Yes | ''permanent page path'' |
| ''slug'' | the [[slug|slug path]] and the short page identifier | Yes | [[docs:page:title|page title]] in slug format |
| ''hierarchical slug'' | the [[docs:page:name|page name]] of **all** [[docs:page:system:index|parent home pages]], the [[slug|slug path]] and the short page identifier | Yes | Na |
| ''homed slug'' | the [[docs:page:name|page name]] of the [[docs:page:system:index|parent home page]], the [[slug|slug path]] and and the short page identifier | Yes | Na |
You may choose the format with the [[#pageUrlType|page url type configuration]]
===== Configuration =====
==== pageUrlType ====
The [[#type|page URL type]] may be chosen with the ''pageUrlType'' [[docs:app:configuration|configuration]].
If you choose a permanent URL, the [[docs:page:page_id|page id]] becomes the only identifier.
The metadata should then be backed up.
* if you have enabled the [[docs:metadata:frontmatter|frontmatter]], you may only backup your page
* otherwise you need to backup also the page metadata directory
==== Relative / Absolute ====
When using a [[#type|page path URL]], you can change the URL path via the [[doku>config:canonical|canonical]] [[docs:app:configuration|configuration]] between:
* relative (default):
./docs/page/url
* or absolute (the domain is added)
https://example.com/docs/page/url
For all other [[#type]], the URL is absolute.
==== Nice ====
You can configure your installation to show nice page URL: [[docs:admin:nice-url]]