Whenever error rises in my application, the server redirects it to the error pages, but the url of that page is visible which could be directly accessible.
for example, if error of 404 rise, it gives the url
http://www.example.com/ErrorPages/Error.aspx
http://www.example.com/ErrorPages/500.aspx
I want to hide that page link. In Web.config I am doing
<customErrors mode="RemoteOnly" defaultRedirect="~/ErrorsPages/Ooops.aspx">
<error statusCode="404" redirect="~/ErrorsPages/ErrorPage.aspx"/>
<error statusCode="401" redirect="~/ErrorsPages/401.aspx"/>
<error statusCode="500" redirect="~/ErrorsPages/500.aspx"/>
</customErrors>
Does anybody have a suggestion for this?