Hi Folks,
I have configured a vanity path for one of the pages. It is working fine in the dev author and publish environments. However, it is not working in the dispatcher, throwing a 404 error in the network tab for the HTML and model.json files for that page.
I have made the necessary dispatcher changes mentioned below:
Farm file:
/vanity_urls {
/url "/libs/granite/dispatcher/content/vanityUrls.html"
/file "/tmp/vanity_urls"
/delay 300
}
Filter rule:
#allow vanity urls list path
/0101 { /type "allow" /extension 'html' /path "/libs/granite/dispatcher/content/vanityUrls" }
However, when I hit the vanity path in the dispatcher, it redirects to the page and then again redirects to a 404 error page. Please help me on this issue to resolve, Thanks in advance!
Views
Replies
Total Likes
hi @jooca, try if this can help https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/libs-granite-dispatcher-co...
Besides check dispatcher configurations:
Another interesting tool you could consider is Vanity Path Rewrite Mapper from ACS Commons.
Hope this help!
Views
Replies
Total Likes
Hi @jooca ,
1. Dispatcher Vanity URLs Setup (Core)
Already have this — just double-confirm:
/vanity_urls {
/url "/libs/granite/dispatcher/content/vanityUrls.html"
/file "/tmp/vanity_urls"
/delay 300
}
Verify
Hit https://<publish-host>/libs/granite/dispatcher/content/vanityUrls.html
Should list all your vanity paths. If empty ➜ flush cache / restart Dispatcher
2. FILTER Rules – Allow Everything Needed
Update filters in dispatcher.any (or vhost if using Apache rules):
# Allow vanityUrls.html access
/0101 { /type "allow" /method "GET" /extension 'html' /path "/libs/granite/dispatcher/content/vanityUrls" }
# Allow HTML & JSON (SPA) for all content
/0102 { /type "allow" /method "GET" /extension '(html|json)' /path "/content/your-site/.*" }
# Allow root-level vanity URLs if applicable (no /content prefix)
/0103 { /type "allow" /method "GET" /extension '(html|json)' /path "/vanity-path/.*" }
# Allow model.json (SPA needs it)
# Handles /content/site/page.model.json
/0104 { /type "allow" /method "GET" /path "*/model.json" }
Important: Update /content/your-site/.* to match your site’s actual path
3. CACHE Rules (SPA needs .html + .json)
Ensure cache allows this
/cache {
/rules {
/0001 { /glob "*.html" /type "allow" }
/0002 { /glob "*.json" /type "allow" }
}
}
4. statfileslevel = 2 (Required for SPA Routing)
SPA routing needs statfileslevel to be at least 2, for correct cache invalidation:
/statfileslevel "2"
5. Flush Dispatcher Cache for Vanity URL File
Manually delete:
/tmp/vanity_urls
Then re-hit:
https://<publish-host>/libs/granite/dispatcher/content/vanityUrls.html
Confirm /tmp/vanity_urls regenerates.
6. Dispatcher Logs = Goldmine for Debug
Run this to see real-time issues:
tail -f logs/dispatcher.log
Regards,
Amit
Views
Replies
Total Likes