We're using OOB Vanity Implementation, wherein if we add the Vanity Property to a page then it would be having a resource resolver mapping with respect to the page.
Let's say I've a page in this path - "/content/vanity/vanity-test" and I've added a Vanity URL(/my-vanity) to that page. Now if I observe the mapping in this path - http://localhost:4502/system/console/jcrresolver , it is having two entries:
- Without .html extension: Having the mapping to the Vanity and Page without .html extension (Please refer the screenshot).
- With .html extension: Having the mapping to the Vanity and Page with .html extension (Please refer the screenshot).
Now because of the second mapping, we're having an issue i.e., in our Web Server we're removing any request having '.html' extension by a '301' redirect. So now with our new Vanity URL changes we're having two redirects(302 and 301) which is the issue (need to have only one redirect).
- First redirection is from vanity url(/my-vanity) to the page(/content/vanity/test-vanity.html) which is a 302 redirect with '.html' extension
- Second redirection is by removing the '.html' extension which is a 301 redirect, through our Web Server Rule, i.e., from /content/vanity/test-vanity.html to /content/vanity/test-vanity.
So now our concerns are:
- Why we have two entries in the JCR Resolver? and
- Do we have any way, where the mapping without .html extension have the precedence over the mapping with .html extension, so that we can avoid one additional redirect. If no, then how can we strip the .html extension without any redirect.
P.S: We need that Web Server Redirect for some other purposes.
Thanks a lot in advance.