Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Vanity URL is not working when CUG is applied in AEMasCS

Avatar

Level 2

we have some sites where we are using closed user groups feature and SAML for authentication.

We authored few vanity urls to the pages which has cug. When we try to hit the vanity urls it is redirecting to 404. 
Dispatcher rules are as follows: we have a rule for shorten URL path. 
# Shorten the tenant path
RewriteRule ^/content/xyz/abc/c1/(.*)$ /$1 [NE,L,R=301]


#prefix with tenant root path
RewriteRule ^/(.*)$ /content/xyz/abc/c1/$1 [PT,L] 

we have enabled,

farm:
/vanity_urls {
/url "/libs/granite/dispatcher/content/vanityUrls.html"
/file "/tmp/vanity_urls"
/delay 300
}
 
we have denied the urls in cache. 
/0003 {
/glob "/libs/granite/dispatcher/content/vanityUrls.html"
/type "deny"
}

and enabled in Filter. 
#Allow Vanity URLs 
/0205 { /type "allow" /url "/libs/granite/dispatcher/content/vanityUrls.html"}


Can we use Vanity URLS with Closed User groups in AEMasCS ? If yes, please provide the steps. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @tejaswi_aem,

Could you try this?

  1. Remove this line from Dispatcher:

    RewriteRule ^/content/xyz/abc/c1/(.*)$ /$1 [NE,L,R=301] ← causes redirect issues
  2. Keep this one (internal rewrite only):

    RewriteRule ^/(.*)$ /content/xyz/abc/c1/$1 [PT,L]
  3. Make sure the CUG login page (eg. /content/xyz/abc/c1/en/login.html) is NOT protected by CUG.

  4. In your /vanity_urls config, make sure the target path (eg./content/.../secure/page.html) is published.

  5. In Dispatcher filters, allow:

    /content/xyz/abc/c1/en/login.html
    /libs/granite/dispatcher/content/vanityUrls.html
  6. The vanity must be authored on the actual page (Properties -> Advanced -> Vanity URL).


Santosh Sai

AEM BlogsLinkedIn


View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @tejaswi_aem,

Could you try this?

  1. Remove this line from Dispatcher:

    RewriteRule ^/content/xyz/abc/c1/(.*)$ /$1 [NE,L,R=301] ← causes redirect issues
  2. Keep this one (internal rewrite only):

    RewriteRule ^/(.*)$ /content/xyz/abc/c1/$1 [PT,L]
  3. Make sure the CUG login page (eg. /content/xyz/abc/c1/en/login.html) is NOT protected by CUG.

  4. In your /vanity_urls config, make sure the target path (eg./content/.../secure/page.html) is published.

  5. In Dispatcher filters, allow:

    /content/xyz/abc/c1/en/login.html
    /libs/granite/dispatcher/content/vanityUrls.html
  6. The vanity must be authored on the actual page (Properties -> Advanced -> Vanity URL).


Santosh Sai

AEM BlogsLinkedIn


Avatar

Administrator

@tejaswi_aem Did you find the suggestions helpful? If you need more information, please let us know. If a response resolved your issue, kindly mark it as correct to help others in the future. Alternatively, if you discovered a solution on your own, we'd appreciate it if you could share it with the community. Thank you!



Kautuk Sahni