Trying to configure JCR Resource resolve in a certain way:
Given requirement:
Where article has path /content/company/en/articles/some/article should be resolved as /some/article
Tried to use this Url Mappings rule (resource.resolver.mapping):
/content/company/en/articles/(.*):/$1
This works in the system console and places like sitemap.xml where ResourceResolver.map is invoked.
However, when trying to open the actual page, following error is returned:
Cannot serve request to /some/article.html on this server
What is wrong with current configuration ?
Thanks,
Peter
Solved! Go to Solution.
Views
Replies
Total Likes
Found that it is possible to solve without the use of regex, simply put /content/company/en/articles/:/ this will resolve everything that starts with articles/ to the root /
Views
Replies
Total Likes
Cross check your mapping with the information in this Sling topic:
https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html
Here is a good community article that may help:
Views
Replies
Total Likes
Thank you for your reply Scott.
Have already read through the sling docs page and url mapping and deep linking.
These articles do not tend to give answer to my particular problem since they both focus on mappings through /etc/map which I am not allowed to use due to some business requirement. All the mappings need to be done through OSGi console. After adding mapping regex in OSGi console 404 error is returned when page is opened.
How should I setup regex for it to work in the OSGi console(given the example described before) ?
Thanks,
Peter
Views
Replies
Total Likes
Found that it is possible to solve without the use of regex, simply put /content/company/en/articles/:/ this will resolve everything that starts with articles/ to the root /
Views
Replies
Total Likes