大网数据广告活动
Web服务器与PHP

Resolve IIS HTTP 404.9 errors for hidden static files

· 52CE 我爱测

Discover how to resolve HTTP 404.9 or Access Denied errors in IIS caused by hidden static files. Follow our guide for quick and easy fixes.

Original product version:   Internet Information Services
Original KB number:   216803

Summary

This article helps you resolve "HTTP 404.9 - Not Found" or "Access Denied" errors that occur when Internet Information Services (IIS) tries to serve static files that have the Windows hidden attribute set. It covers the cause of this behavior, and provides two methods to fix the issue.

Symptoms

Static files that have the hidden attribute set return an "HTTP 404.9 - Not Found" or "Access Denied" error message when you request them. However, dynamic files are still served successfully.

Cause

This behavior is by design. IIS doesn't serve static files (such as .html, .css, .js, or image files) that have the Windows hidden attribute set. When a client requests a hidden static file, IIS returns an "HTTP 404.9 - Not Found" or "Access Denied" error message.

Dynamic content isn't affected by this behavior because IIS modules or handler mappings process this content instead of serving it directly. For example:

  • ASP.NET pages (.aspx) are handled by the ASP.NET ISAPI extension or the managed handler in the integrated pipeline.
  • Classic ASP pages (.asp) are handled by the Asp.dll ISAPI extension.
  • Server-Side Includes (.stm, .shtm, .shtml) are handled by the Ssiinc.dll ISAPI extension.

These handlers read and process the file content on the server before they send the response to the client. This behavior bypasses the hidden-file check that applies to static file requests.

Solution

To resolve this issue, use one of the following methods.

Remove the hidden attribute from the file

If you don't have to hide the file, remove the hidden attribute so that IIS can serve the file normally:

  1. In File Explorer, right-click the file, and select Properties.
  2. On the General tab, clear the Hidden checkbox.
  3. Select OK.

Alternatively, run the following command in an elevated Command Prompt window:

attrib -h <PathToFile>

Use NTFS permissions instead of the hidden attribute

If you want to restrict access to certain files, use NTFS permissions instead of the hidden attribute. NTFS permissions give you detailed access control, and they don't stop IIS from serving the file to users who are authorized.

  1. In File Explorer, right-click the file or folder and select Properties.
  2. Select the Security tab.
  3. Select Edit to change permissions, and then add or remove users or groups to control access.
  4. Select OK to apply the changes.

Important: Make sure the IIS application pool identity (for example, IIS AppPool\<AppPoolName>) has Read permission on any files that IIS needs to serve.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 03/25/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。