Today I tried to publish a site developed in Laravel. When I have send all my files on the server I realised that styles are not being applied. Css file are being loaded, because I get in console:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://xxx.xx/build/css/app-e3022e1832.css"
And I think here is the problem. Take a look at headers of app-e3022e1832.css
, escpecialy at Content-Type
:
HTTP/1.1 200 OK
Date: Thu, 08 Sep 2016 14:27:29 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: IdeaWebServer/v0.80
Content-Encoding: gzip
When I put the same .css file on an external server, than the file gets Content-Type: text/css
and everything is working fine. The same thing happens when I deleted all Laravel files, than my css files are getting normal Content-Type: text/css
and styles are being applied properly.
That gives us a proposal, that Laravel is changing the Content-Type
of .css
files, but I used Laravel in another projects and everything was working fine.
What could be the problem?