While browsing the Internet you might have come across these kind of error
messages, Page not Found, You are Not Authorized to View this page, HTTP
Error 404 - File or directory not found, etc. This type of errors are called
as status code errors and you can set these kind of errors in the ASP.NET
Web.Config file. The type of error will be identified by the HTTP status
code. The Web.Config file for that looks like this:
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly">
<error statusCode="404"
redirect="Default.aspx"/>
</customErrors>
This should be added to he System.Web or merged with existing markup.
It hsould be noticed that this will only work for files that asp.net is
handling. Meaning if somebody requests bleah.html it will use the
default IIS 404 handler.
In order to get this behavior for all files you should set a custom 404
handler through IIS for that application/website.
This may or may not be offered by your web hosting company if you are
hosting with a ISP and you should contact them regarding this if so.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.