Alexandre
Alexandre

Reputation: 4602

IIS 7.5 - Files with no extensions causing Error 404.17

I am currently developping an ASP.NET MVC4 Website and I am trying to include javascript timezone support for JQuery Flot with date.js.

The timezones informations of date.js are stored into text files with no extensions (ex: tz/northamerica).

When using the Visual Studio Development Server, I can GET any of my timezone files with no problems, but once it's hosted using IIS, I get the following error:

HTTP Error 404.17 - Not Found

The requested content appears to be script and will not be served by the static file handler.

Most likely cause:

The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

Things you can try:

If you want to serve this content as a static file, add an explicit MIME map.

The rest of my website works perfectly, only those extension less files are causing hiccups.

I am very unfamiliar with IIS configuration, what exactly is the issue here?

Upvotes: 3

Views: 1830

Answers (2)

Max Hay
Max Hay

Reputation: 259

https://serverfault.com/questions/720043/iis-8-5-serve-file-with-no-extension-from-particular-folder

As per the above, if you include the following within your web.config it'll allow you to serve static extensionless files.

<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension="." mimeType="application/octet-stream" />
        </staticContent>
    </system.webServer>
</configuration>

Upvotes: 0

dnord
dnord

Reputation: 1742

Looks like it was a problem with IIS 7.5 that you can patch.

Upvotes: 2

Related Questions