iisiis-7.5file-not-foundrequestfiltering

HTTP Error 404.7 - Not Found The request filtering module is configured to deny the file extension


I'm trying to configure the default webpage for an IIS 7.5 website.

Request filtering is turned on. However .aspx pages are allowed, I've set default.aspx to be the default page for the website.

If I browse to localhost/default.aspx I get a webpage as expected.

IF I browse to localhost/ I get

HTTP Error 404.7 - Not Found The request filtering module is configured to deny the file extension.

Any ideas?


Solution

  • It looks like the request filtering is actually filtering for a blank file name. Therefore you have to add this to the request filtering block in the web.config:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <security>
          <requestFiltering>
            <fileExtensions allowUnlisted="true">
              <remove fileExtension="." />
              <add fileExtension="." allowed="true" />
            </fileExtensions>
          </requestFiltering>
        </security>
      </system.webServer>
    </configuration>
    

    It's obvious now, but really I think its a massive gotcha.


    More info: IIS 7 Not Serving Files - 404.7 Error