Question

Using HiddenSegments IIS7 is preventing browsing of folders like /bin and /app_data

At the moment the site is displaying a blank page, is it possible to route this to my standard 404 page?

Was it helpful?

Solution

Of course you can. Here is my web.config file which I regularly use:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors>
            <remove statusCode="403" subStatusCode="-1" />
            <remove statusCode="500" subStatusCode="-1" />
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" subStatusCode="-1"
prefixLanguageFilePath="" path="/errordocs/404.htm" responseMode="ExecuteURL" />
            <error statusCode="500" subStatusCode="-1"
prefixLanguageFilePath="" path="/errordocs/500.htm" responseMode="ExecuteURL" />
            <error statusCode="403" subStatusCode="-1"
prefixLanguageFilePath="" path="/errordocs/403.htm" responseMode="ExecuteURL" />
        </httpErrors>
    </system.webServer>
</configuration>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top