AEM : How to lowcase source url of vanity_urls
I configed the vanity_urls in the dispatcher.
/vanity_urls {
/url "/libs/granite/dispatcher/content/vanityUrls.html"
/file "/tmp/vanity_urls"
/delay 300
}
The values of the /libs/granite/dispatcher/content/vanityUrls.html are
test1
test2
test3
In the AEM, the vanity url maps are
test1 mysite/home
test2 mysite/about
test3 mysite/product
Now, If I enter the https://docker.demo.com/test1, it will redirect to the https://docker.demo.com/mysite/home.
But If I enter the https://docker.demo.com/TEST1, I will get a 404 error.
Expected:
If I enter the https://docker.demo.com/TEST1, it would first convert to the https://docker.demo.com/test1, and then redirect to the https://docker.demo.com/mysite/home.
If I enter the https://docker.demo.com/TEST6, since test6 is not in the vanity_urls, so it will direct to the https://docker.demo.com/TEST6 and not convert it to lowcase.
Does anyone know how to achieve it?
BTW : I configed the ErrorDocument in the apache. If a page is not found, it will redirect to the error page. So I can't change the 404.jsp of error handle (sling\servlet\errorhandler) to achiece it.
ErrorDocument 404 /home/errors/404.html
Thanks,
Forrest