Redirect old .asp or any non aspx pages using 404

Add this to the System Webserver section in the web.config file to handle any non .aspx pages


<httpErrors errorMode="Custom">

<remove statusCode="404" subStatusCode="-1" />

<error path="/" prefixLanguageFilePath="" responseMode="ExecuteURL" statusCode="404" />



Just keep in mind that the Error Path section can be set to whatever file you require the error to be redirected to.

error path="/"
error path="/errorpage.htm"
error path="/404.aspx"

etc etc.
  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

How to create a Virtual Directory

How to create a Virtual Directory (Application for If you need to...

Web.config file does not run

If your web.cofig file doesnt run (Even though the error keeps telling you to modify the...

How to use the session state server (Sessions issues)

If you are having problems loosing sessions please use the session state server. (ASP.NET only)...

How to change DOT NET Version (Site level)

Login to your control panel at Please note: Ensure you set your...

Cross-Site Scripting in ASP.NET

Cross-Site Scripting in ASP.NET Cross-site scripting attacks exploit vulnerabilities in Web page...