Skip to content
Johan Janssens edited this page Mar 10, 2021 · 9 revisions

Pages are a literal representation of your site’s URL structures. Each Page lives in a hierarchy among other Pages. Together they form a logical tree structure made of parents, children, and siblings.

Table of Contents

Structure

Each page has its own slug, in a hierarchical structure, the slugs of each page are combined to create the page URL. Example:

/pages
  ├── menu.html.php
      ├── specials.html.php 
      └── wine-list.html.php

Because of that parent/child relationship, the following URLs are now available on the site, each with its own unique content.

Slugs

The slugs used to generate the URL are based on the page file name. To change the page slug, simply change the filename to match it.

Slugs are primarily used to make URLs more user-friendly, easy to remember and help your users know what to expect before clicking a link. Search engines will rank pages higher if the search word is in the URL.

Note: Routes configuration could override the slugs. The slug would not take effect if the configuration for the route is different from the filename.

Format

The format of the page can be defined through the URL extension, or by adding ?format=[format] to the URL. For example http://example.com/menu.rss or http://example.com/menu?format=rss would look for a menu page with content type RSS.

As is typical with most web platforms, the default format is HTML. This means that when a user requests a page in their browser, for example: /blog/new-product-launched, because there's no file extension Pages assumes an HTML page is being requested.

Pages will look for a file that matches the format, in the case of /blog/new-product-launched it will look for

/pages
 └──blog
    └── new-product-launched.html

If the user requested the format explicitly via /blog/new-product-launched.html, Pages would still look for that same file.

Canonical

A canonical URL is a technical solution for duplicate content. You might, for instance, have a post or product that is attached to two categories and exists under two URLs, like so:

https://example.com/black-shoes/black-and-red-shoes/
https://example.com/red-shoes/black-and-red-shoes/

If these URLs are both for the same product, choosing one as the canonical URL tells Google and other search engines which one to show in the search results.

A canonical URL is always created for a page (even if the canonical route is used). This ensures clean self-referential URLs. Pages handles this out-of-the-box for you.

See also: Using Rel Canonical on All Pages for Duplicate Content Protection