404 Error on Folder / Directory in ASP.Net on IIS7

Hi Experts!

I've Googled the hell out of this and am getting nowhere. I have created a website and need to get a custom 404 error page working.

I know how to do this so that it works for file requests. EG, if someone requests http://www.mywebsite.com/page.aspx and it doesn't exist, I can make it forward on to the 404 correctly using the web.config file.

However, if I request http://www.mywebsite.com/folder (IE, with no file extension so it's looking for a folder that does not exist), I get this bad boy:

ASP.Net 404 Error Page
I'd have thought I need to change something in IIS, but don't know where to start with that.

Any help much appreciated.

Bob
LVL 3
BobeoAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
David Johnson, CD, MVPConnect With a Mentor OwnerCommented:
click on edit feature settings and turn off detailed errors for local requests and custom error pages for remote requests and set it to custom error pages
custom errors
0
 
gery128Commented:
you might want to disable Directory browsing for your site. that would prevent accessing folders/directories directly.
0
 
BobeoAuthor Commented:
Perfect!

Cheers for your help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.