Matthew
Matthew

Reputation: 11613

IIS7 returns 404 on some static files, not others

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.

Upvotes: 8

Views: 8630

Answers (2)

Daniel Szabo
Daniel Szabo

Reputation: 7281

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'

Upvotes: 2

Aaron Gibson
Aaron Gibson

Reputation: 1378

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

Upvotes: 5

Related Questions