The Tomcat RewriteValve is an Apache Tomcat component that inspects incoming requests and applies rules to rewrite, redirect, allow, or block them before they reach an application. It works at the web-server/request-processing layer, so administrators can normalize URLs, force safer paths, or deny requests that match patterns such as traversal sequences, suspicious encodings, or unwanted hosts.
In cyber security, this matters because many attacks start with malformed paths. A RewriteValve rule can stop obvious probing, reduce exposure to path traversal bugs, and enforce cleaner request handling when an application is not robust enough on its own. It is not a complete fix for vulnerable code, but it is a useful defense-in-depth control in front of sensitive Tomcat-hosted services. Security teams often use it alongside patching, logging, and reverse-proxy filtering to limit how attackers can reach risky file paths or bypass normal routing.


