Using vanity URLs (Site settings SEO)

December 29, 2022

What is a vanity URL?

Vanity URLs (also known as Friendly URLs) are additional, customizable and unique web addresses for pages and contents, which are useful for the website visitor to remember a specific page. It is also very important for search engines, as they are used to describe the content of the page. It also make things easier for your marketing campaigns. More details about Vanity URLs are available on techterms.com..

For example, the following URL 
https://www.jahia.com/en/home/company/events.html

can be converted into
https://www.jahia.com/events

How can Jahia help me with vanity URLs?

By default, the URL of a page in Jahia is built by using the technical names of the pages, and by following the structure of the site. For instance, if you have a page “About” under the homepage of your site, you will access it with the following URL: http://domainname/home/about.html . The more levels you have in your site, the longer the URL will be. So if you have a page “History” under the About page, then its URL will be: http://domainname/home/about/history.html 

To shorten such URL, make them more user friendly, and/or to work on the Search Engine Optimization (SEO), you can manually add custom URLs, vanity URLs, to your page. The only constraint is that the value chosen for theses URLs must be unique on your site. For instance, you can add the following vanity URLs for the “History” page:

  • /history
  • /company-roots
  • /how-it-started

The page will then be available using any of the following URLs:

  • http://domainname/home/about/history.html
  • http://domainname/history
  • http://domainname/company-roots
  • http://domainname/how-it-started

It is also possible to specify a default vanity URL, which will be used in the navigation menus, when creating links, etc.

In a multilingual site

Vanity URLs are also useful for sites available in several languages. Jahia prefixes the path of the page with the corresponding language: the French version of the blog page is available using the following URL:
https://www.jahia.com/fr/home/company/events.html. Using vanity URLs allows you to also translate the URL in the given language: https://www.jahia.com/fr/societe/evenements

A vanity URL is specific to one and only one language. The unicity of the vanity URL on the site still applies, so you cannot use the same vanity URL for the same page in two different languages. In the previous example, ttps://www.jahia.com/fr/societe/evenements, the “/fr/” is part of the Vanity URL, in order to explicitely inform that the page is in French.

Where to find vanity URLs management in Jahia?

Vanity URLs can be added on pages (which is the most frequent use case) and on content items that can be displayed in full page, like news or blog articles.

It is possible to manage vanity URLs from the following interfaces:

  • Vanity URL panel in Content Editor, when editing pages.
  • Vanity URLs dashboard accessed from jContent>Additional>Vanity URLs
Note: Once a vanity URL has been set on a page in Content Editor or using the Vanity URLs dashboard, a publication of the page or the vanity URL itself is required to activate it in the live version of your site.sdf

Managing vanity URLs when editing a content

The panel to manage and edit the vanity URLs is available when editing pages or files in the 3 dots menu, at the top right of the Content Editor form. 

accessing-vanity-URL-content-editor.png

 

Editing vanity URLs for a page / content / file

Adding vanity URLs

Simply click on the Add vanity URL button then start typing the vanity URL, and click Save.

adding-vanity-url.png

When saving the value, if the vanity URL doesn't start with a slash (/), a slash is automatically added at the beginning. The vanity URL can only contain letters, digits, dots (.), dashes (-) and no consecutive slashes. By default, the language selected for the vanity is the one selected in Content Editor, but it's possible to change it if needed.

Note that the panel displays vanity URLs of all languages for the page. 

Editing a vanity URL

You can edit an existing vanity URL by clicking on it.

editing-vanity-url.png

An error message is displayed when clicking on the save button in the following cases:

  • The vanity URL already exists on another page
  • The vanity URL contains non valid characters (only letters, digits, dots (.), dashes (-) and no consecutive slashes are allowed).

To change the language of a vanity URL, click on the current language and select the new one in the drop-down.

Publishing / Making your vanity URL active

There are 2 ways to publish a vanity URL (make the vanity URL active on the live version of the site): 

  • Publish the vanity URL, by clicking on the 3 dots on the right of the vanity URL and confirm the publication.
    publish-vanity-url.png
  • Publish the content, file or page associated with the vanity URL

Viewing published / non published values

At the top left of the vanity URL panel, it is possible to switch between "Staging vanity URLs", "Live vanity URLs" and "Staging and Live". It is only possible to edit the staging vanity URLs. To change the values of the live vanity URLs (the ones that are active on the site), you'll need to edit the staging value and then publish.

switch-staging-live.png

Status color

If a vanity URL has a green status, it means that it is the same in both edit version and online. In other words, the vanity URL has been published and hasn’t been modified ever since.

The orange status signifies that either the vanity URL has never been published, or that it has been modified since the last publication.

Setting a vanity URL as canonical

The canonical vanity URL defines the vanity URL to use in the navigation menus, links, etc. Only one canonical vanity URL is possible per language and per page/content. Defining a vanity URL as canonical will also automatically add the canonical link tag to the head of the page for the vanity.

A page can only have one canonical vanity URL per language. If no vanity URL is defined as canonical, the path of the page will be used as canonical.

When defining a new vanity URL as the canonical one, then the property is automatically removed on the other vanity URL: It is then advised to publish both vanity URLs at the same time. 

For more information on the hreflang tags, you can scroll to the alternate and canonical section. 

Deleting a vanity URL

The deletion of a vanity URL is a two step process:

  1. Deletion in “staging”: Click on the ‘delete’ button trash.PNG. A confirmation window is then displayed. If the vanity URL has never been published, then the vanity URL is fully deleted. If the vanity URL has been previously published, the vanity URL is still functioning in live.
  2. Deletion in "live": Delete the live (published) version of the vanity URL, by going to "live vanity URLs" and clicking on the delete button trash.PNG for the selected vanity. Once done, the vanity URL does not work in live anymore. It is also possible to publish the page (or content or file) to delete the vanity in live.

delete-vanity-url-2.png

Warning: It is only possible to delete all the vanity URL for a page in live. Individual deletion in live is not supported.

Moving a vanity URL

It is possible to move a vanity URL in Content Editor (i.e. in “default”) from a source page to a destination page. The vanity URL will point to the source page until the move of the vanity URL is published or until the publication of the destination page.
In order to move a vanity URL, just move your cursor on the vanity URL and then click on the "move.PNG Move" button. You will then be able to either select a page by browsing the site page tree, or you can directly enter the path of the destination page or content.

move-vanity-url.png

Activating or deactivating a vanity URL 
activate.PNG

Deactivating a vanity URL means that the vanity URL will not be usable online once it is published. In other words, the page will not be displayed if a visitor uses the vanity URL in their browser. A “404 Page not found error” page will be displayed instead.
To deactivate a vanity URL, simply use the toggle button. You will then need to publish the vanity URL to deactivate it in live as well:

A deactivated vanity URL appears in grey:

deactivated-vanity.png

In this example “/how-it-started” is deactivated in both edit and live. “/history” has been deactivated in default, but it has not been published yet, so it is still activated in live.

Vanity URLs dashboard

The Vanity URLs dashboard is accessible in jContent>Additional>Vanity URLs.

vanity-url-dashboard.png

It lists all the pages and contents which have at least one vanity URL. By clicking on a page or content you will display all its vanity URLs:

vanity-url-dashboard-opened-vanity.png

Filter per language

The panel displays by default the vanity URLs in all the available languages of the site. It is possible to only display the vanity URLs of one or several languages, by selecting the desired languages in the language selector:

dashboard-5.PNG

This selector lists the different languages activated on the site.

Filter by keyword

It is possible to filter the pages/contents by searching for part of one of their vanity URL. Then only the vanity URL corresponding to the search terms are displayed, but it is possible to show all the vanity URLs of the page/content by clicking on the Show all button.

Note: Unfortunately, it is currently not possible to search by using the page/content title.

Operations on multiple vanity URLs

It is possible to perform the same operations on several vanity URLs previously selected:

  • Delete
  • Move
  • Publish

It is possible to select vanity URLs from different pages, by selecting the checkbox next to a mapping. The top checkbox allows you to select or unselect all the vanity URLs of a page.
When one or several vanity URLs is/are selected, then the available operations are displayed at the top of the screen:

vanity-url-multi-select.png

Canonical and alternate tags

In the HEAD section of html pages, it is considered a good practice to add 2 information related to URLs that will help Google index your site correctly: 

By default, since version 3.x of the site-settings-seo module, canonical and alternate tags are automatically added.

It is possible to disable the automatic generation of <link rel="canonical" ...> and <link rel="alternate" ...>, by editing a value inside the configuration file: org.jahia.modules.sitesettingsseo.config.impl.ConfigServiceImpl.cfg.

Set the property enableSEOAutomaticMetaTagGeneration from true to false.