Customize page addresses and URLs

Composer allows you to give each page a custom URL in addition to its name.

A page's web address - its URL - is automatically derived from its name. In the example above, is a page called "School Calendar." If this page were created at the "root" level of a site (just below the homepage in the site hierarchy), its URL would be www.[domain].com/school-calendar.

A page's address is not derived only from its own page name, however. Pages that are located several layers deep in a site's hierarchy will also reflect the address of their "parent" pages in the URL. Here's the actual structure surrounding the "School Calendar" page.

2540_-_branch_and_page_name.png

Notice that it's in a branch called "Training Site," and that branch has a homepage with the same name. Because the School Calendar page is drawing its address from its own name AND that of its parent page, the actual URL for this page is www.[domain].com/training-site/school-calendar/.

This is reflected in the Settings window for this page.

2018-10-09_12-45-01.png

Here you can see not only how a page derives its URL from its own page name, but also from its parent. Direct URLs list any parent pages first, followed by the name of the page itself.

You can also see that the Page Settings window allows you to edit the very last portion of the page's URL - you can click on "school-calendar" in the settings window and replace it with something else. This user-editable portion of the page's address is called the "slug." By default, the slug is simply the page's name, rendered in a web-compatible format (lowercase letters, with words separated by a hyphen.)

We can change this to whatever we want, for instance, changing "school-calendar" to simply "calendar." Doing so would change the page's URL to be "www.[domain].com/training-site/calendar/".

Changing a page's URL does not affect its name. Likewise, after a page has been created, changing the page name will not automatically change its URL. You must edit the slug in order to modify the page's web address.

If you change a page's URL by editing the slug, that change will cascade down to any of its "child" pages. For example, let's go to the "Training Site" page and edit its URL (without changing the page name).

2540_-_change_parent_slug.png

Now, if we go back to the original "Calendar" page, its URL reflects the new slug from the Training Site page, even though we never edited the Calendar page's URL directly.

2540_-_updated_page_name.png

Finally, notice the "link" icon to the left of the page URL. You can click on that icon to copy the page's complete URL to your clipboard, so that you can easily paste it in elsewhere.

Short vanity URLs

To create a simple URL for a page with a longer URL, for example "yourschool.org/apply" as a shortcut to "yourschool.org/admissions/online-application," you'll need to set up a redirect page in Composer.

The best practice for this is to set up a "Redirects" branch in Composer. If you do not already have one, this can be created by hovering over your main domain in Composer and clicking “New Branch.”

2018-10-09_12-48-40.png

From there:

  1. Create a new page under the Redirects branch.

  2. Set it to be a Linked Page.

  3. Set the URL to whatever you'd like your short vanity URL.

  4. Make sure “Internal Redirect” is selected, and choose the page you'd like this vanity URL to point to.

2018-10-09_12-51-03.png

Save and publish this new page, and your short URL should now redirect you to the page you set.

Forbidden URLs

There are a few restrictions to keep in mind when creating vanity URLs. For example, the use of only numbers (with no other characters) in a vanity URL is not allowed. Restricting the use of purely numerical slugs allows us to load pages and route site traffic more efficiently, while also helping enforce best-practice naming conventions. This means that mysite.com/2017 is NOT a valid URL, however, mysite.com/fundraiser2017 is perfectly acceptable. The use of special characters, including underscore "_" is also forbidden, as their use is not considered a best practice.

Was this article helpful?
6 out of 11 found this helpful

Comments

0 comments

Please Sign in to leave a comment if you don't see the comment box below.