- Installed the VanityURLS-Components
- Allowed ‘Read’ permission to /libs/granite/dispatcher/content/vanityUrls for the ‘everyone’ group on the publish servers
Added a filter rule in the dispatcher to allow the vanity URL
/0100 { /type "allow" /url "/libs/granite/dispatcher/content/vanityUrls.html" }
Added a caching rule to prevent caching of this URL
/0001 { /type "deny" /glob "/libs/granite/dispatcher/content/vanityUrls.html" }
Added the vanity_urls configuration to the farm:
/vanity_urls { /url "/libs/granite/dispatcher/content/vanityUrls.html" /file "/xxx/vanity_urls" /delay 300 }
Restarted webserver
- Created a file inside file location and provide required write permission. -rwxr-xr-x 1 apache apache 0 May 14 14:26 vanity_urls
- Verified /libs/granite/dispatcher/content/vanityUrls.html page is accessible from pub as anonymous request
- Verified /libs/granite/dispatcher/content/vanityUrls.html page is accessible from dispatcher
- Verified all required modules are enabled in Apache
- Verified that dispatcher is calling pub server upon hitting the /libs/granite/dispatcher/content/vanityUrls.html, seeing logs in request.log
- Finally restarted Apache Sling Resource Resolver bundle and simply saved it's configuration and restarted AEM server
Dispatcher logs:-
[root@disp-server-1:/path/path]# tail -f *.log | grep vanityUrls
[Fri May 15 10:21:27 2020] [D] checking [/libs/granite/dispatcher/content/vanityUrls.html]
[Fri May 15 10:21:27 2020] [D] cache-action for [/libs/granite/dispatcher/content/vanityUrls.html]: NONE
[Fri May 15 10:21:27 2020] [I] "GET /libs/granite/dispatcher/content/vanityUrls.html?Ad3=3" 200 none [farm/rend01] 40ms
10.56.0.58 - - [15/May/2020:10:21:27 +0000] "GET /libs/granite/dispatcher/content/vanityUrls.html?Ad3=3 HTTP/1.1" 200 172 "-" "Amazon CloudFront"
2020-05-15-dispatcher.log:[Fri May 15 10:26:20 2020] [D] checking [/content/demosite/en/game1]
2020-05-15-dispatcher.log:[Fri May 15 10:26:20 2020] [D] request URL has no extension: /content/demosite/en/game1
2020-05-15-dispatcher.log:[Fri May 15 10:26:20 2020] [D] cache-action for [/content/demosite/en/game1]: NONE
2020-05-15-dispatcher.log:[Fri May 15 10:26:20 2020] [I] "GET /content/demosite/en/game1" 404 none [farm/rend01] 21ms
game1 is the vanity url here.
The vanityurl is working only on publisher server and not on the dispatcher side.I have tried all the possible option but could not find out why it is not working? The pain part is there is no error messages in the any of the logs. Has anyone faced similar issue? Please help me to investigate further on this issue?