0

I used amazon ec2 to host my website. I wanted to switch from redhat to amazon linux because the latter is cheaper. After I configured apache server and the django settings for my website, everything worked fine but the layout of html. The css didn't work at all. However, if I compare the source file of the html with that of in my own laptop, they look the same.

From the html source file, the link of the css file is correct, i.e, if you click the link, you can see the css file. But I don't know why the background picture didn't show up, and the sidebar is below the content. Everything is as if there is no css.

Have anybody encountered this weird situation before?

ohmygoddess
  • 619
  • 1
  • 7
  • 23

1 Answers1

1

Google Chrome DevTools reports:

Resource interpreted as Stylesheet but transferred with MIME type text/plain.

Response Headers for your css file:

Accept-Ranges: bytes
Connection: close
Content-Length: 1892
Content-Type: text/plain; charset=UTF-8
Date: Fri, 05 Jun 2015 06:39:54 GMT
ETag: "40945-764-517bea2cb7b4f"
Last-Modified: Fri, 05 Jun 2015 05:33:46 GMT
Server: Apache/2.2.29 (Amazon)

You need to configure Amazon web server and set correct content type for styles.

Next link can help you https://serverfault.com/questions/405229/apache-delivering-css-and-js-files-but-browsers-dont-render-them

Community
  • 1
  • 1
Philip Dernovoy
  • 1,169
  • 6
  • 17
  • Thanks for respond! I added the type="text/css" in the , I also configured the httpd.conf with AddType as you suggested. Now chrome devtool shows the type of css is stylesheet. But still, css didn't work – ohmygoddess Jun 05 '15 at 15:23
  • Now, it works! I guess it might took some time for refresh... Thanks a lot! – ohmygoddess Jun 05 '15 at 15:40