title: Can apache return a JSON response to 404 and other errors?
body: <p>There is plenty of documentation on how to customize the 404 (and other error) response pages, but they all result in an HTML response to the client. If the client is an application making REST calls the HTML is useless and does not fit the Accept request header of "application/json".</p>
  
  <p>Is there a way to customize not just the content, but also the headers that are returned for 404 and similar errors? Even better, would like to write code that examines the request header Accept value and returns a response in the expected format.</p>