pdvries
pdvries

Reputation: 1382

Resource interpreted as Stylesheet but transferred with MIME type text/html (IIS)

I get the following warning in Chrome: "Resource interpreted as Stylesheet but transferred with MIME type text/html." This happens when running the website in the browser from IIS 8 (on Windows 8). If I run the website from Visual Studio (2010) using the File System I have no issues (meaning that the CSS has been applied to the website and the website is viewed as expected).

I've read through some posts on this issue, but have not yet been able to resolve it. If someone can give me some suggestions, that would be great.

Upvotes: 3

Views: 12487

Answers (6)

Manish Jain
Manish Jain

Reputation: 1353

Follow these steps:

1. Open turn windows features on or off


2. Select and enable Internet Inforamtion Services


3. Select and enable World Wide Web Services


4. Select and enable Common HTTP Features


5. Enable Static Content


6. Press ok

Upvotes: 3

Mark Pearson
Mark Pearson

Reputation: 66

Similar to pjdevries, in my case, this was caused by the inetpub folder being copied or recreated on another volume by the sysadmin. The solution was to grant the local users group execute, read and list permissions to the new inetpub folder

Upvotes: 0

blapsley
blapsley

Reputation: 132

This was a permission issue for myself. I have a problem with new projects my company shares and it allowing my app pool permissions. I have to go in and add the my-pc\Users group and tell it to trickle down the permissions, and give it full rights. Even when I thought I did this to get me access to the page, the JS / CSS files didn't have that group. After re adding it again, the CSS and JS files loaded up and this message was gone from the debugger.

Upvotes: 2

George
George

Reputation: 6084

adding "AddType text/css .css" to my .htaccess in root folder worked for me.

Upvotes: 0

pdvries
pdvries

Reputation: 1382

Actually, I just found out that in my case it happened to be a rights (permissions)-issue. I had a look at the MIME-types before in IIS and they we're set accordingly, that is for CSS set to "text/css". When I added the Users-group to have permissions on the website-folder to have "Read & execute, List folder contents and Read"-permissions set to Allow, it solved the issue.

Conclusion It may be that due to using a different root websites-folder for IIS that you're CSS "cannot be accessed" properly. Though you would think that the problem is with you're MIME type settings in IIS, it may be that the User-group (you probably need to add the IIS_IUSRS-group as well if you haven't already) wasn't added to the default root folder of where you're websites are located and thus experience this issue.

Upvotes: 5

user1551327
user1551327

Reputation:

In your configuration file add the css mimetype (text/css), it worked for me..

Upvotes: 0

Related Questions