Smaller 406 stylesheet on IIS7 / discountaspnet

I have a website, http://www.allampersandall.com , which I am trying to publish on discountasp.net. It works fine locally in VS2010 debugging, but when I send it to all my .less HTTP 406 files.

When I looked for HTTP 406, it says that the browser does not accept it, but why does it start locally, but does not work live?

Any ideas?

Thanks,

+4
source share
1 answer

I fixed it at the end ....

Error 406 basically tells you about the mismatch between the expected browser and what the server sent.

In my case, it was the fact that my web.config was telling the browser that any files with the .less extension should be used as the mime type "text / css".

<staticContent> <mimeMap fileExtension=".less" mimeType="text/css" /> </staticContent> 

Where, as on my site, the file was declared as "text / less"

 <link href="@Url.Content("~/Content/style.less")" rel="stylesheet/less" type="text/less" /> 

To fix this, I changed the "mimeType" parameter in the web.config file to match the declaration on the page, so now the web.config section:

 <staticContent> <mimeMap fileExtension=".less" mimeType="text/less" /> </staticContent> 

I hope this helps!

Greetings

+12
source

All Articles