Microsoft KB Archive/942045

= Error message when you try to browse a Web page that is hosted on IIS 7.0: &quot;HTTP Error 404.7 – FILE_EXTENSION_DENIED&quot; =

Article ID: 942045

Article Last Modified on 9/24/2007

-

APPLIES TO


 * Microsoft Internet Information Services 7.0

-



SYMPTOMS
When you try to browse a Web page that is hosted on Internet Information Services (IIS) 7.0, you receive the following error message:

Server Error in Application &quot; &quot;

HTTP Error 404.7 – FILE_EXTENSION_DENIED

HRESULT: 0

Description of HRESULT # The operation completed successfully.



CAUSE
This problem occurs because the allowUnlisted attribute is set to false. Additionally, the file name extensions of the files that you want to browse are not listed.



RESOLUTION
To resolve this problem, follow these steps:  Click Start, type Notepad in the Start Search text box, right-click Notepad, and then click Run as administrator.

If you are prompted for an administrator password or for a confirmation, type your password or click Continue. On the File menu, click Open. In the File name box, type %windir%\System32\inetsrv\config\applicationHost.config, and then click Open. In the applicationHost.config file, press CTRL+F to search for the  section.  In the  section, locate the following code:    Replace the code that you found in step 4 with the following code: <fileExtensions allowUnlisted=&quot;true&quot;> Note If you want to deny some specific file name extensions for security, you can explicitly add these extensions. For example, see the following code: <requestFiltering> <fileExtensions allowUnlisted=&quot;true&quot;> <add fileExtension=&quot;.asa&quot; allowed=&quot;false&quot; /> <add fileExtension=&quot;.asax&quot; allowed=&quot;false&quot; /> <add fileExtension=&quot;.ascx&quot; allowed=&quot;false&quot; /> <add fileExtension=&quot;.master&quot; allowed=&quot;false&quot; /> </fileExtensions> </requestFiltering> </li> On the File menu, click Save.</li> Close Notepad.</li> Run a Web application that has a file name extension that is not listed in the child elements of the <fileExtensions> section.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
The default setting of the allowUnlisted attribute is true. The allowUnlisted attribute is under the <fileExtensions> element of the applicationHost.config file in IIS 7.0.

You can view the IIS 7.0 Web log file to find the file name extensions in the request. The Web log file is in the following location:

%SystemDrive%\inetpub\logs\LogFiles\W3SVC 

To determine the number of, follow these steps: <ol> Click Start, type Notepad in the Start Search box, right-click Notepad, and then click Run as administrator.

If you are prompted for an administrator password or for a confirmation, type your password or click Continue.</li> On the File menu, click Open. In the File name box, type %windir%\System32\inetsrv\config\applicationHost.config, and then click Open.</li> In the applicationHost.config file, press CTRL+F to search for the section.</li>  In the section, locate the code that resembles the following: <site name=&quot;Default Web Site&quot; id=&quot;1&quot;> Note In this code, 1 in the id=&quot;1&quot; represents. Therefore, in this example, the Web log file is in the following location:

%SystemDrive%\inetpub\logs\LogFiles\W3SVC1

</li></ol>

For more information about the fileExtensions element for the requestFiltering element in IIS 7.0, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/aa347451.aspx

Keywords: kbexpertiseadvanced kbtshoot kbprb KB942045

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.