title: Custom error page in tomcat for HTTP 501 error
body: <p>Before anything else, I've already read all those solutions that says I put an error-page block in my application's or tomcat's conf/web.xml and add an error-code block inside with the corresponding location and those didn't work (did those for 404 errors and those worked).</p>
  <p>What I already did inside my application's and tomcat's web.xml:</p>
  <pre><code>&lt;error-page&gt; &lt;!-- this worked --&gt;
      &lt;error-code&gt;404&lt;/error-code&gt;
      &lt;location&gt;/pageNotFound.html&lt;/location&gt;
  &lt;/error-page&gt;
  
  &lt;error-page&gt; &lt;!-- this did not work --&gt;
      &lt;error-code&gt;501&lt;/error-code&gt;
      &lt;location&gt;/pageNotFound.html&lt;/location&gt;
  &lt;/error-page&gt;
  </code></pre>
  <p>I'm using Tomcat 8.5.63, and the goal is to remove the &quot;Apache Tomcat/8.5.63&quot; part on the response whenever a 501 error appears.</p>
  <p>I want to remove this part:
  <a href="https://i.stack.imgur.com/K8qSr.png" rel="nofollow noreferrer">tomcat error response page</a></p>
  <p>The way I'm testing this is that I intercept a request using a pentest tool (I'm using burp suite community) and modify a request to include a <code>Transfer-Encoding: cow</code> header (yes I know that header is invalid).</p>
  <p>Any ideas on how to implement a custom page so that the 501 can be handled properly?</p>