Vanity URLs are alternate reference paths to internal or external URL's. Vanity URLs are most commonly used to give visitors to the website a more user-friendly or memorable way of reaching an HTML page or File, that might actually live “buried” in a much deeper path. This can be extremely useful for email Campaigns or creating promotional links.
- The Vanity URLs Portlet
- Adding or Editing a Vanity URL
- Redirect Types
- Search Engine Optimization (SEO)
The Vanity URLs Portlet
The Vanity URLs portlet displays a list of all Vanity URLs on your site. To open it, select Marketing -> Vanity URLs.
You can perform the following actions from this screen:
|Add||To create a new Vanity URL, click the Add New Vanity URL button on the top right of the screen.|
|Edit||To edit a Vanity URL, click on it's Title or URL in the list.|
|Visit Destination URL||To visit the destination file or page, click on the path in the Redirect To: column.|
|Search||To search for Vanity URLs, type the text to search for in the Search: field and press the Search button.|
The list will be filtered to display all Vanity URLs which include the search text in any field (including Title, URL, or Redirect To).
Adding or Editing a Vanity URL
When creating or editing a Vanity URL, you must give the Vanity URL a Title, select which Host the Vanity URL applies to (or “All Hosts”), and supply a “virtual path” to the destination in the URL field. You can either type in the URL for a link or use the click here to browse button to browse for an internal destination.
Note: Please see Redirect Types, below, for an explanation of how the URL entry affects what type of redirect is performed.
In the example below, a Vanity URL (www.dotcms.org/documentation) has been created that will display the page
Once you have saved the Vanity URL, test the new “virtual” path by typing it directly into your web browser.
If you set the Redirect To: field of a Vanity URL to a full URL (e.g.
http://dotcms.com/docs/latest/table-of-contents), dotCMS will perform a 301 redirect whenever a user accesses the specified URL. The URL displayed in the user's browser will change to display the Redirect To: address, and all links on the destination page will be referenced from the Redirect To path.
If you set the Redirect To path to a relateive path (within your Site Browser tree, e.g. “/docs/latest/table-of-contents”), dotCMS will perform a requestdispatcher forward (a transparent forward) whenever a user accesses the specified URL. The URL in the user's browser will not be changed.
Vanity URLs created in this way are true URL's which maintain their presence in a website browser's navigation toolbar even after the destination HTML page or file is reached. However if there are links on the destination page which are relative to your Site Browser tree, these links may not work, since they will be referenced from the Vanity URL's URL local (e.g. /documentation) rather than from the actual location of those files in your Site Browser tree (e.g. /docs/latest).
Search Engine Optimization (SEO)
On Google and some other search engines, the location of your page in search results may change if the same content is available via two different URLs (such as with a Vanity URL and the page the Vanity URL points to). To maximize your page ranking in search results, you may specify the canonical URL for any Page Asset. This directs the search engines to combine the search result data for the main page and any Vanity URLs linked to that page.
To specify the canonical URL, open the Page Properties, select the Advanced Properties tab, and edit the Canonical URL field. Once this field has been set, dotCMS will automatically add a canonical URL link to the page header each time the page is displayed (either directly or through a Vanity URL).
For information on other ways to maximize search engine optimization for pages referenced by Vanity URLs, please see Use canonical URLs on the Google help site.