1

I tried the solution proposed in this thread: Apache2 won't load css files on Debian 6 (Squeeze)

I added .htaccess files in every directory, containing

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

But it did not work.

Neigther worked the Apache howto http://httpd.apache.org/docs/2.2/howto/htaccess.html#page-header, telling me to place the types in the Directory directive in apache2.conf

The mime_module (shared) is loaded.

Anything I found via Google led me to one of those two solutions.

What am I doing wrong?

2 Answers 2

0

Mime types for CSS and javascript should be enabled per default. Check if the mime module is loaded, by running:

apachectl -M | grep mime

It should return "mime_module (shared)". If not, enable the mime module by running

sudo a2enmod mime

If the mime module is enabled, but those types are not defined, you can add them to the file /etc/mime.types (for the whole system) or /etc/apache2/mods-enabled/mime.conf (for apache). If you want to use .htaccess file, you have to enable them first (https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles), but I would recommend to make sure that these types are enabled centrally.

2

I too had the same issue. I had imported the bootstrap file in my application.css at the top. It was causing me issues.

So I placed the same import at the bottom after the comment lines in the application.css file. It worked like a charm!

1
  • Unbelievably, this was actually the issue for me as well...
    – veljkoz
    Sep 14, 2017 at 16:11

You must log in to answer this question.

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