title: Setting an ErrorDocument 404 in .htaccess causes jQuery's AJAX call to never error
body: <p>Alright, so I tried to use .htaccess to set up ErrorDocuments for various error codes. It works great, except that now, the following jQuery AJAX code will never run the error() function:</p>
  
  <pre><code>$.ajax({url: url, type: "GET", cache: false, error: function(){
   alert("Looking rather erroneous, are we?");
  }, success: function(html){
   // ...
  }
  </code></pre>
  
  <p>Any proposals? I think I know the reason why: .htaccess points all errors like so:</p>
  
  <pre><code>ErrorDocument 404 /error.php
  </code></pre>
  
  <p>And /error.php has the following:</p>
  
  <pre><code>&lt;?php header("Location: /#error"); ?&gt;
  </code></pre>
  
  <p>So when it transfers to index.php, it probably loses the 404 document status.</p>
  
  <p>What would you suggest?</p>