Magento – Static files version folders not found hence design collapsed and getting 404 for all css and js

404js-cssmagento2.2.2

I was trying to rectify some ACL issues in my application I removed the static folder inside the pub and I run di:compile and static-content:deploy. Also, I have given 777 permission to var and generated folders, Now when I open the application in the browser no css and js is loaded, I have seen many similar issues but in my case the css and js files are available but the version folder is not available I mean if I saw the source code the URL's are like

http://ipaddress/magento2/pub/static/version1515489121/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css

But the actual file is like

/var/www/html/magento2/pub/static/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css

As I mentioned in the example the version folder is not showing

I don't understand how the folders are created without the version folder.

Best Answer

try to the following:

php bin/magento setup:upgrade

then

php bin/magento setup:di:compile

then

php bin/magento setup:static-content:deploy

then

sudo chmod 777 -R var

and check the following apache2 configuration:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

if you find AllowOverride None

Change it to AllowOverride All

Regards,

Related Topic