title: Faking Http Sub Status Codes in IIS/.net for testing
body: <p>Now this is tightly coupled to the question I raised and had <a href="https://stackoverflow.com/questions/7724998/faking-http-status-codes-in-iis-net-for-testing">answered yesterday</a>. </p>
  
  <p>This question/answer works well for testing asp.net errors (such as straight for 500, 404, 502 etc errors) but when I have tried to test errors such as 500.13 - Web server is too busy, or 502.2 - Bad gateway, I can't work out how to do this. </p>
  
  <p>I think there is a clear difference between error generated/handled by asp.net and those by IIS (IIS dealing with the sub status codes such as 500.13 etc.).</p>
  
  <p>Has anyone any ideas on how to test these? I found to handle these sub status errors in the web.config you do so in the following way:</p>
  
  <pre><code>&lt;httpErrors errorMode="Custom" existingResponse="Replace"&gt;
    &lt;clear/&gt;
    &lt;error statusCode="404" path="/errorPages/404.html" responseMode="Redirect"/&gt;
    &lt;error statusCode="500" path="/errorPages/500.html" responseMode="Redirect"/&gt;
    &lt;error statusCode="500" subStatusCode="13" path="/errorPages/500.13.html" responseMode="Redirect"/&gt;
    &lt;error statusCode="502" subStatusCode="2" path="/errorPages/502.2.html" responseMode="Redirect"/&gt;
  &lt;/httpErrors&gt;
  </code></pre>
  
  <p></p>
  
  <p>To recap, I simply want to be able to simulate/replicate an sub status error such as 500.13 or 502.2 in .net so that I can test IIS returns the correct page I have specified in the web.config.</p>
  
  <p>Thanks</p>
  
  <p>Dan</p>