Solved

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

Posted on 2012-03-23
3
393 Views
Last Modified: 2012-03-26
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
Comment
Question by:Bobeo
3 Comments
 
LVL 9

Expert Comment

by:gery128
ID: 37757061
you might want to disable Directory browsing for your site. that would prevent accessing folders/directories directly.
0
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 37760375
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
 
LVL 3

Author Closing Comment

by:Bobeo
ID: 37765157
Perfect!

Cheers for your help!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP:DataGrid and how to bind to a BoundColumn 8 30
IIS 7.5 to 8.0 6 75
dynamic menu in asp.net c# 11 31
sccm report 1 14
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now