I am running Tomcat 8.0.30, and want to redirect all requests that result in a 403 (Forbidden) to 404 (Not Found). The idea is that if someone uses something like DirBuster, it will look like any files/directories that result in a 403 error are not there. I have found numerous tutorials online for accomplishing this with Apache HTTP Server, but nothing for Tomcat. How can I create something like a redirect/rewrite rule to redirect 403 to 404? Thank you for you insight.

  • You may be able to use the answer from this SO article to achieve your desired result: <a href="stackoverflow.com/questions/5444359/…> I believe .htaccess would work the same in Tomcat as in Apache. – darnold0714 Jan 22 '16 at 18:06
  • There is no .htaccess in Apache Tomcat – raupach Jan 26 '16 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.