Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After using nginx for a few months, which worked pretty well, I decided to switch back to Apache. Now, I have just installed apache2, but it seems like it won't load my CSS files. I've been struggling with it for hours now and I don't know what else to do; I just did a clean install from Apache and created this virtual host (see below) but it still doesn't work.


This is the virtualhost I'm using for it (note that I have commented out the rewrite rules):

<VirtualHost *:80>
     DocumentRoot /srv/www/
     ErrorLog /srv/www/
     CustomLog /srv/www/ combined

     #     RewriteEngine On
     #     RewriteCond %{REQUEST_FILENAME} !-f
     #     RewriteRule ^/?([^/]*)/?$ /index.php?a1=$1 [L]
share|improve this question

migrated from Feb 17 '13 at 20:07

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

Enable mod_mime and add the following lines in your httpd.conf (or a .htaccess):

AddType text/css .css
AddType text/javascript .js
share|improve this answer
Thanks, works now. Very weird, it should just work out of the box. I should't add this manually. And no, I haven't changed ANYTHING to the configuration files. That's what makes it so weird it didn't just work by itself. – WouterDS Feb 17 '13 at 15:57
@Simon I am having same issues, however followed this answer and still cannot load .css files – Richard Feb 18 '13 at 17:17
What do you mean by 'not loading'? Is it not adding the text/css Content-Type header or is the file not sent to the browseR? – Simon Feb 27 '13 at 11:10

When I load your website and look into the console, it displays the following error

[16:37:08.652] The stylesheet was not loaded because its MIME type, "text/plain", is not "text/css". @

It seems you're missing an appropriate mime type. Although, the default configuration of debian should do this already.

share|improve this answer
Exactly it should just work.. Anyway, how can I add it manually? – WouterDS Feb 17 '13 at 15:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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