How i do force 404 error for a particular request?
I don't wish to exclude the page from the site.
However if the user requested for the below two files, I would always return 404 Error Page NotFound.aspx
/site/employee/pensionplan.aspx
/site/employee/pensiondoc.pdf
I have been told that not to use the web.config for 404 error configuration, due to some security issues
. I am not sure what exactly the problem
<!-- Turn on Custom Errors -->
<customErrors mode="On"
defaultRedirect="DefaultRedirectErrorPage.aspx">
<error statusCode="404" redirect="Http404ErrorPage.aspx"/>
</customErrors>
What is the best way to redirect a user to a Not Found
page when he trying to access a particular resource?