After installing Magento 2.0.2 without sample data and then switching to Production mode via CLI the following files are showing missing (404):
/pub/static/_requirejs/frontend/Magento/luma/en_US/secure/requirejs-config.js
It appears this file exists, only one level below where it should - there is no "secure" folder. Note this file is also attempting to load twice.
/pub/static/frontend/Magento/luma/en_US/jquery/jquery-storageapi.js
This file is nowhere to be found, but a jquery.storageapi.min.js does exist at that location.
Running "magento setup:static-content:deploy" results in the same errors.
You need to set the proper filesystem permissions: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html
Already checked. All good.
I have the same problem, any solution for that?
How to fix the problem of loading css and javascript files? https://mage2.pro/t/259
This problem appears when you have https on your server. If you add HTTPS="on" to your server environment variables all should works well (I didn't find it in documentation but I've checked the code and find this solution). Also you can add this variable to you bash script call, for instance:
HTTPS="on" php magento setup:static-content:deploy
You can follow below steps and it will be fix.
1) Set deploy mode to production - **php magento deploy:mode:set production**
(js and css minification will works with production mode.If you are in developer mode with code minified above issues will show up as I experienced it. If minification disabled you can keep the developer mode. Also verify using echo the print_r($_SERVER) in index.php that production mode or developer mode correctly set before load the website)
2) Clear all the caches setup in server
- **/etc/init.d/nginx restart**
- **/etc/init.d/php5.6-fpm restart**
- **/etc/init.d/varnish restart**
3) Clear the browser cache and view it in incognito mode. That's it!
Cheers!