Reputation: 3441
I have a website, lets assume it's
www.mydomain.com/a
I also have a page named
list.aspx
I added configuration settings to the web.config file to customize the errors (mainly 404,500).
It works perfectly except for when the request is not a page, for example
www.mydomain.com/a/lEst.aspx //my custom page appears
www.mydomain.com/a/list //doesn't work (without aspx extension)
www.mydomain.com/B/aasd.aspx //doesn't work
When the custom errors that don't work, the hosting server displays his own custom page.
How can I fix this?
Upvotes: 1
Views: 106
Reputation: 8337
customErrors
in system.web
will work only with ASP.Net extensions because it is ahndled by ASP.Net worker process. If you are using IIS7, user system.Webserver
section.
<httpErrors errorMode="Custom" existingResponse="Replace" >
<remove statusCode="404"/>
<error statusCode="404" path="/error404.aspx" responseMode="ExecuteURL"/>
</httpErrors>
Upvotes: 1