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...


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.

  • Yes, you are right! most of them are 'Content-type: text/plain' Any tip on how to change them? – jacktrades Jul 5 '12 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 '12 at 22:51
  • It was enabled, added those lines. You are a Genius! – jacktrades Jul 5 '12 at 22:57
  • 2
    Nah, just someone who's had exactly the same problem in the past ;-) But thanks! – Jay Jul 5 '12 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.