Can someone help me with the rewrite rule for the below scenario?
If I hit http://test.test.ca/reader?id=0f69571b-a2ce-4c04-8df8-dc46b137f677 should redirect to this url http://test.test.ca/apps/sling/servlet/asset/test-reader?id=0f69571b-a2ce-4c04-8df8-dc46b137f677, Here id is dynamic and will be different each request and apps/sling/servlet/asset/test-reader is where the resourcetype node reside for my servlet.
Solved! Go to Solution.
Views
Replies
Total Likes
I had to add a slash to the above rule you gave as below
RewriteRule "^/reader""/apps/sling/servlet/asset/test-reader"[PT]
and that worked. Thanks a lit @arunpatidar
Hi,
If you have servlet in /apps then you need to allow anonymous user for accessing the this servlet.
Although the redirect rule is
RewriteEngine on
RewriteRule "^reader" "/apps/sling/servlet/asset/test-reader" [PT]
Thanks @arunpatidar . The anonymous read only access to that node is already in place and so we are good with that perspective.
But I have a doubt in the rewrite rule. So, shouldn't add anything related to id in the rewrite rule?
Hi,
Its not needed, you can test the rule in the link which I have shared or in local dispatcher setup
Sure. Thanks a lot @arunpatidar
I had to add a slash to the above rule you gave as below
RewriteRule "^/reader""/apps/sling/servlet/asset/test-reader"[PT]
and that worked. Thanks a lit @arunpatidar
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies