I need to redirect to my generic errorpage, when a users tries to access a directory that doesn’t exist. I set up the following in my web.config:
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="errorpages/404.htm">
</customErrors>
</system.web>
It works like a charm when I access a file that does not exist (eg. xyc.com/does_not_exist.aspx) but when I access a folder that does not exist (eg. xyz.com/does_not_exist) then I get a normal 404 instead of the generic errorpage.
What am I missing?
Best regards,
Steffen
Change to:
~/specifies from root directory