Hi All,
I need some assistance on rewrite rule to fulfill my requirement.
Here is my requirement.
i have dispatcher url http://abc.com ,so when i hit a url by appending a content which is not in dispatcher/publish level
ex: if i hit url http://abc.com/nocontent/test.html or http://abc.com/nocontent/test.txt or http://abc.com/nocontent/test.img etc...this needs to go http://abc.com only
so my intention is whatever will append which not there it should redirect to home page like http://abc.com only...can someone please give me suggestion to achieve this on dispatcher
Thanks,
Amarnath.
Solved! Go to Solution.
Views
Replies
Total Likes
In the dispatcher, add following line of code
ErrorDocument 404 http://abc.com
Refer Custom Error Responses - Apache HTTP Server Version 2.4
In AEM ,copy /libs/sling/servlet/errorhandler/404.jsp to /apps/sling/servlet/errorhandler/404.jsp and apply redirect logic.
HI Amarnath,
It may useful
1. in your 404.jsp , you can forward to your website
2. same you use rewrite rules to redirect to domain dispatcher, when 404
Thanks
Ravindra
In the dispatcher, add following line of code
ErrorDocument 404 http://abc.com
Refer Custom Error Responses - Apache HTTP Server Version 2.4
In AEM ,copy /libs/sling/servlet/errorhandler/404.jsp to /apps/sling/servlet/errorhandler/404.jsp and apply redirect logic.