/HttpFallback

Libraries to throw fallback HTTP errors instead of 404

Primary LanguageHTMLMIT LicenseMIT

Build Status

HttpFallback

Libraries to throw fallback HTTP errors instead of 404

Available error pages

  • 400

  • 401

  • 403

  • 404

  • 500

  • 501

  • 502

  • 503

  • 520

  • 521

  • 533

Usage

Normal Asp.NET websites

Add the handler to your Web.config file.

<system.webServer>
  ...
  <handlers>
    ...
    <add name="Http404Handler" verb="" path="*" type="HttpFallback.AspNet.Http404Handler, HttpFallback.AspNet" />
  </handlers>
  ...
</system.webServer>

Check the Available error pages topic to know which error codes can be used

Owin web applications

Add this to your Startup.cs file:

app.Use<HttpFallbackOwinMiddleware>(404)

Check the Available error pages topic to know which error codes can be used

Acknowledgements

The Error pages were copied from the project HttpErrorPages

Donations

Did you find this project useful? Consider making a donation.

Donate via PayPal