How can I make www.mywebapp.com/bin return a 404 in ASP.NET MVC?
        Posted  
        
            by Freewalker
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Freewalker
        
        
        
        Published on 2010-01-06T19:31:49Z
        Indexed on 
            2010/03/24
            0:13 UTC
        
        
        Read the original article
        Hit count: 790
        
asp.net-mvc
|iis7
I'm using ASP.NET MVC to develop a web application, deploying to IIS 7. I've hidden my Files and Views directories with web.config files in those directories (they just return a normal 404).
However, I haven't been able to get the web.config method to work in hiding my bin directory. When I access www.mywebapp.com/bin, I instead get a too-revealing page with this message:
HTTP Error 404.8 - Not Found
The request filtering module is configured to deny a path in the URL that contains a hiddenSegment section.
The page reveals part of my directory structure. I just want it to return my 404 page like the Files and Views directories do. How can I get this behavior?
© Stack Overflow or respective owner