CSS and Javascript files are not loading after Magento 2 installation

If you facing problem of css and design after installation in Windows please follow the following steps:

step 1. php bin/magento setup:static-content:deploy

step 2. php bin/magento indexer:reindex

step 3. make sure apache "rewrite_module" is enabled and then restart the server

step 4. delete cache folder under var/cache

The above steps are working for me.I hope this will work for you also.

Let me know if you still facing any problem.


This could be an issue with symlinks. I see that deploy.php worked for you, but you may also try deleting the resources from pub/static and seeing if the instructions from https://magento.stackexchange.com/a/64808/594 work for you. If so, then it may save you some time during development as it should be faster than running deploy.php.

It would also be good to know if multiple people are hitting issues with the symlinks and what the common cause is.


My issue was that I had gotten a little too excited with my pub/static and pub/media "cache clearing" and accidentally deleted the .htaccess file in pub/static.

A quick fix was to pull in a fresh /magento2ce/pub/static/.htaccess and flush the cache and Bob's your uncle. No more CSS issues.

Hope this helps. It'd be awesome if there was a way to remove files and somehow make sure other files didn't get removed, like a .gitignore for system linux rm -rf use. Maybe one day...

PLEASE NOTE: this is only for the CSS issues, sorry I'm not helping with the missing JS problem.