developer documents: Vanity URLs in Adobe Experience Manager (AEM) allow authors to define custom, shorter, or more user-friendly URLs for pages directly in the page properties, which are then published and handled by the Dispatcher for caching and security. To enable Dispatcher to dynamically fetch and allow these vanity URLs without manually updating filters for each one, a specific configuration section must be defined in the Dispatcher configuration file (typically dispatcher.any). This section instructs Dispatcher on how to retrieve the list of vanity URLs from the AEM publish instance, store them locally, and automatically permit requests matching those URLs to bypass certain deny rules.
The correct property for defining this configuration is /vanity_urls, which is a child block under the /farms section in the Dispatcher configuration. This block contains sub-properties such as:
/url: The endpoint on the AEM publish instance to fetch the vanity URL list (e.g., "https://publish.example.com/libs/granite/dispatcher/content/vanityUrls.html ").
/file: The local file path where Dispatcher caches the fetched vanity URL list (e.g., "/tmp/vanity_urls"). Dispatcher requires write access to this file.
/delay: The interval (in seconds) between periodic fetches of the vanity URL list from AEM (default is 60 seconds).
/loadOnStartup: A boolean (0 or 1) to load the vanity URLs immediately when Dispatcher starts (default is 1).
For the vanity URL feature to function:
Install the VanityURLS-Components package on the AEM publish instance(s) from Adobe's Software Distribution to enable the /libs/granite/dispatcher/content/vanityUrls.html servlet.
Ensure Dispatcher filters deny vanity URL paths by default (e.g., via a rule like { /type "allow" /method "GET" /url "/libs/granite/dispatcher/content/vanityUrls.*" /extension "html" } to allow the fetch, but deny the vanity paths themselves).
Add the /vanity_urls block under /farms/{farmname}.
Restart the Apache web server after configuration changes.
If not configured correctly, errors like "Vanity URL file (/tmp/vanity_urls) not found, fetching..." may appear in Dispatcher logs, followed by failures if the AEM endpoint is unreachable.
Exact Extracts from Adobe Experience Manager (AEM) Sites Developer Documents:
From "Configure AEM Dispatcher": "Add the /vanity_urls section below /farms. Restart Apache web server. ... The value of this property must be '/libs/granite/dispatcher/content/vanityUrls.html'. /file: The path to the local file where Dispatcher stores the list of vanity URLs. Make sure that the Dispatcher has write-access to this file. /delay: (Seconds) The time between calls to the vanity URL service. ... If your render is an instance of AEM, you must install the VanityURLS-Components package from Software Distribution to enable the vanity URL service."
From "AEM Dispatcher vanity URLs feature": "For this reason, the Dispatcher module has a feature to auto-allow anything listed as a vanity in the content tree. ... Simple Dispatcher has an auto-filter allow mechanism and you have to install an AEM package and then configure the Dispatcher to point to that package page."
From "AEM Dispatcher Common Logs": "Thu Sep 27 17:40:29 2018 D pid 21844 Checking vanity URLs Thu Sep 27 17:40:29 2018 D pid 21844 Vanity URL file (/tmp/vanity_urls) not found, fetching... Thu Sep 27 17:40:29 2018 D pid 21844 Loaded 18 vanity URLs from file /tmp/vanity_urls"