Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Vanity url is not working with dispatcher in AEM 6.4

Avatar

Level 4
 
I am trying to setup vanity url in AEM 6.4. Followed and verified the below steps
  • 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?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

11 Replies

Avatar

Employee

With the Dispatcher log level at DEBUG can you share the log output for the vanityUrl request? 

 

Do you have the vanityurls component installed?

It's an old package from 2015 that oddly enough doesn't come with the product ootb.

 

Screen Shot 2020-05-14 at 1.28.07 PM.png

Avatar

Level 4
Downloaded the package from package share - https://www.adobeaemcloud.com/content/marketplace/marketplaceProxy.html?packagePath=/content/compani... Package version - vanityurls-components-1.0.2 Is there any higher versions available?

Avatar

Level 4
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

Avatar

Community Advisor

Hi,

 

For me, it looks like dispatcher filter is blocking the requests and not sending them to publisher. Once you enable the debug logs, you should be able to see this info on dispatcher log.

 

Look at the rules order where you're allowing and denying the access to /libs.

 

Thanks.

Hi Noksc - No, the dispatcher is not blocking this path. vanityUrls service is accessible even from dispatcher URL – https:/{disaptherDomain}/libs/granite/dispatcher/content/vanityUrls.html. I could also the Dispatcher is making call to AEM publisher, the response to this request is 200 as well. Allowing this path - /0100 { /type "allow" /url "/libs/granite/dispatcher/content/vanityUrls.html" } Not caching this path - /0001 { /type "deny" /glob "/libs/granite/dispatcher/content/vanityUrls.html" }

Avatar

Level 3

@Anderson_Hamer Can you please confirm if this issue got resolved? I am also facing the same issue

Avatar

Level 4

@Anderson_Hamer : We are also facing the same issue. What changes you have done in apache config which fixed the issue

Avatar

Level 3

@Anderson_Hamer @subrato_kha @subrato_kha @pn_2007 @Singaiah_Chintalapudi 

 

Did you guys final solution?

 

Could you please share your findings pls, would be great help.