Dispatcher Rewrite Rule



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



View Entire Topic



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.

Refer Custom Error Handler Pages