IIS7 returns 404 on some static files, not others

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 01:02:40

问题


I have a css file and a js file in a directory. The css file returns 200 OK while the js file returns 404 Not Found.

They have the same permissions. IUSR, IIS_IUSRS, Internet Guest Account all have (at least) Read.


回答1:


Add the file type to IIS MIME TYPES. It wont serve unknown file types.




回答2:


Adding the file type to the IIS MIME Types worked for me. Fortunately for caveman-brains like mine, IIS let's you do this with the UI.

From the MS website

To use the UI

  1. Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).
  2. In Features View, double-click MIME Types.
  3. In the Actions pane, click Add.
  4. In the Add MIME Type dialog box, type a file name extension in the File name extension text box. For example, type .xyz
  5. Type a MIME type in the MIME type text box. For example, type 'application/octet-stream'


来源:https://stackoverflow.com/questions/14818826/iis7-returns-404-on-some-static-files-not-others

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!