Vanity url not working due to Dispatcher rewrites | Community
Skip to main content
Level 3
September 22, 2023
Solved

Vanity url not working due to Dispatcher rewrites

  • September 22, 2023
  • 2 replies
  • 1208 views

Hi Team,

 

We followed this article https://medium.com/@toimrank/aem-vanity-url-bce73e71d960  to configure Vanity URL.

But it did not work because of Dispatcher rewrite rules. Vanity URLs always get rewritten based on Dispatcher rewrite rules and does not work as expected.

 

E.G. Page A has vanity url something like /abc. 

and  we have rules written at dispatcher level as below:

RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/bin
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/saml_login
RewriteCond %{REQUEST_URI} !^/system
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
RewriteCond %{REQUEST_URI} !(.html|.jpe?g|.png|.svg)$
RewriteRule ^/(.*)$ /content/mysite/us/en/$1.html [PT,L]

 

PROBLEM:  when we hit url like localhost:4503/abc... It always redirects to /content/mysite/us/en/abc.html and as a result it gives 404.

 

Is there any way to by pass this rewrite rules for all Vanity URLs?

 

Regards,

KTNR

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mohit_KBansal

Dispatcher auto-allow filters is correct way to handle it, if its not working, means there are some problem with your configuration.

 

Alternatively, you can ask editors to setup vanity in AEM with context path as prefix, so instead of setting a vanity "/abc", you should configure "/content/path/to/home/abc"

For end user, there wont be any impact, as they will be able to access /abc

2 replies

Mohit_KBansal
Adobe Employee
Adobe Employee
September 22, 2023
Level 3
September 22, 2023

@mohit_kbansal  Thank you for your reply.

 

We have followed all standard procedures also included auto-filter. 

 

When we comment above dispatcher rewrite rules , Vanity works perfectly fine. 

 

So is there anyway to by pass these Dispatcher rewrite rules for all Vanity URL?

Regards,

KTNR

Mohit_KBansal
Adobe Employee
Mohit_KBansalAdobe EmployeeAccepted solution
Adobe Employee
September 24, 2023

Dispatcher auto-allow filters is correct way to handle it, if its not working, means there are some problem with your configuration.

 

Alternatively, you can ask editors to setup vanity in AEM with context path as prefix, so instead of setting a vanity "/abc", you should configure "/content/path/to/home/abc"

For end user, there wont be any impact, as they will be able to access /abc

kautuk_sahni
Community Manager
Community Manager
September 26, 2023

@arvindpandey Did you find the suggestion from @mohit_kbansal helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni