When sling mapping is used there is any way to set a application order?
In our case we have a set of rules to "shorten" part of the URL and another to remove the .html at the end:
Also we define a few rules to avoid break the resources under /bin/, /etc/, /mnt and so on
All of this rules are at the same level under, /etc/map/http
The problem we have is when we add the mapping to allow the remove of the .html
the rules added for /bin/, /etc/, /mnt/ get changed by: /project/xx/yy/[bin||etc||mnt], so for example the replication service isn't working.
Does anybody face this problem?
When considering etc mappings, you always have to remember one major consideration i.e. the dispatcher cache. The reason I am mentioning this is because it's a fairly critical implication that goes unnoticed.
Before I get to the html stripping part, I'd like to focus on the path shortening and also the fact that you don't need to write any sling mapping rules for /bin, /etc, or otherwise. When you create sling:mappings, you define a sling:InternalRedirect and in that internal redirect setting, which by the way is a string array, you define them as the following. The mappings below get resolved in a certain order until a valid hit in aem is resolved. This is the mapping which will save all your requests to /bin, /etc, /mnt. etc from getting a HTTP 404.
Regarding the html extension stripping, you can do this by going to "Day CQ Link Checker Transformer" in /system/console/configMgr and select "Strip HTML Extension".
Putting these two together, you must ensure that your dispatcher is caching properly. For example, if a request comes in as http://mywebsite.com/sitea, and the dispatcher passes it along as it is, the dispatcher will cache it incorrectly and further invalidation might lead to more problems.
You should read the article http://www.cognifide.com/our-blogs/cq/multidomain-cq-mappings-and-apache-configuration/ for a quick overview of this implementation.
I hope this helps.
Hi, thank you for your quick responses!
Arun Patidar thanks, here is the current mapping we have, (appologies for the probably mess):
|content - dam|
|html localhost.8080 - es|
|localhost.8080 - ca|
|localhost.8080 - en|
|localhost.8080 - es|
The idea behind the mappings on localhost - en, localhost - es, localhost - ca is:
For en and ca:
For es is to be able to have links like:
Ones on bin, clientlibs, mnt, content - dam, etc, libs, mnt, are to avoid the a wrong mapping of the resources under those paths
The main problem comes with the html localhost.8080 - es, when we add it,
the site recognizes the previous links but it becomes kind unstable, some services are not longer recognized, such as the /bin/receive for example.
smacdonald2008 thanks for your response,I'll try to give it a new lecture,
maybe we are having a wrong idea of how to implement or even if the idea is feasible using sling mappings.
aneeta45259594 thanks for the detailed response.
As you mention the ideal should be focus on the shortening properly avoiding to tocuh anything else rather than our project, but we are in a kind of "hurry" situation.
I'll check the mapping you propose and see how it behaves and see if it can perform well with the other language mappings.
We are thinking in combine the sling mapping to shorten the URL's and leave the html management to the web server.
I'll try to update the post with any advance in the process.