I was trying to rectify some ACL issues in my application I removed the static folder inside pub and I run di:compile and static-content:deploy and I gave 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


But the actual file is like


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.

  • Actually the issue is while removing the static files I should have took the backup for the htaccess file, I missed it. I replace the htaccess file from the repository then its fine. – Abel Jan 9 '18 at 12:08
  • But there is no image in the pub/media file. – Abel Jan 9 '18 at 12:09

try to the following:

php bin/magento setup:upgrade


php bin/magento setup:di:compile


php bin/magento setup:static-content:deploy


sudo chmod 777 -R var

and check the following apache2 configuration:

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

if you find AllowOverride None

Change it to AllowOverride All


  • I tried your solution and @qazqaz999 both of them bring back the magento placeholder image instead of broken image but not the original one. – Abel Jan 15 '18 at 5:18

In this case, you had "Sign Static Files" enabled (found in Magento admin > Stores > Configuration > Advanced > Developer > Static Files Settings).

This is enabled so that the browser can detect when a newer version of a static file (CSS/JS/HTML) is available for use. This is enabled preferably when your site is subject already for go-live.

When you're in production mode (you can check this through php bin/magento deploy:mode:show) and this is enabled, you can't afford to lose the .htaccess file inside the /pub/static folder. The .htaccess file routes the request for the static files' towards /pub/static.php. And this file will load the static files.

  • I tried your solution and @Mohamed Elkashef both of them bring back the magento placeholder image instead of broken image but not the original one. – Abel Jan 15 '18 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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