PHONE 1300 138 046  Australian Owned and Operated  All prices in Australian Dollars

Knowledgebase

Portal Home > Knowledgebase > Windows clients > ASP.NET > Redirect old .asp or any non aspx pages using 404

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


<system.webServer>

<httpErrors errorMode="Custom">

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

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

</httpErrors>

</system.webServer>


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

Example:
error path="/"
Or
error path="/errorpage.htm"
Or
error path="/404.aspx"

etc etc.
 

Was this answer helpful?

Add to Favourites Add to Favourites Print this Article Print this Article

Also Read