• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

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
0
Bobeo
Asked:
Bobeo
1 Solution
 
gery128Commented:
you might want to disable Directory browsing for your site. that would prevent accessing folders/directories directly.
0
 
David Johnson, CD, MVPOwnerCommented:
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
 
BobeoAuthor Commented:
Perfect!

Cheers for your help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now