11

A webpage is being hosted by apache2, CentOS 6.2.

It Gets HTML, CSS, JS files ok to the client side. But CSS and JS don't render, What can be hapenning? Since they should run 100% on client side...

1 Answer 1

15

The mime types are probably wrong.

Check they're serving the content with Content-type: text/javascript or Content-type: text/css. You can check this using the Network tab of Chrome's Inspector or Firebug.

You'll need mod_mime, and ensure you have these lines in your httpd.conf:

AddType text/css .css
AddType text/javascript .js

That should do it.

4
  • Yes, you are right! most of them are 'Content-type: text/plain' Any tip on how to change them?
    – jacktrades
    Jul 5, 2012 at 22:42
  • Please see my edits. You can also put those lines in a .htaccess if you really have to, but will still need mod_mime.
    – Jay
    Jul 5, 2012 at 22:51
  • It was enabled, added those lines. You are a Genius!
    – jacktrades
    Jul 5, 2012 at 22:57
  • 3
    Nah, just someone who's had exactly the same problem in the past ;-) But thanks!
    – Jay
    Jul 5, 2012 at 23:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .