Vanity url not working due to Dispatcher rewrites
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