We've implemented URL shortening using the etc/map node, and error handling using the /apps/sling/servlet/default/errorhandler/404.jsp. The 404.jsp contains a line that looks like
The relevant entry in etc/map has a sling:Match of en_US/ and a sling:internalRedirect of /content/NorthAmerica/client/en_US/pages/home/
This correctly shortens the links on pages in the site, and if I browse to www.client.com/en_US/asdf.html, I correctly get the error page rendered, but all the links on it have lost the URL shortening behavior.
If I change the error handling JSP to
request.getRequestDispatcher("en_US/404.html").forward(request,response); or request.getRequestDispatcher("/en_US/404.html").forward(request,response);
then I get a blank page instead of the error page when I browse to asdf.html
Is there a way to get these to work together? Also, I don't really have a good grasp of how the etc/map nodes fit into the process of locating a resource, rendering it, and issuing the response. Is there documentation around that?
Additional info...I had thought that maybe the problem was that because the request was being forwarded to the full path, the etc/map was inferring that I didn't want URL shortening to take effect. However, if I browse to /content/NorthAmerica/client/en_US/page/home/404.html in a browser, the URL-shortening does still take effect.