0

I think I tried all the suggested method. But not working.

php bin/magento setup:static-content:deploy

php bin/magento indexer:reindex

I also deleted cache, changed permission of pub/static to 777. Nothing did help.

Admin login page design is also broken. But once logged in, then everything looks fine.

On the browser, error message says, "404 not found" and "Script from [URL] was blocked due to mime type mismatch" for the css and javascript files

What could be wrong?

4
  • are you getting any error ? Check in core_config_data table that your css or js are merged or not?
    – BornCoder
    Feb 2, 2017 at 13:46
  • in system log, nothing. Also nothing in the error_log of the root folder.
    – user9839
    Feb 2, 2017 at 13:50
  • Try deleting these directories: pub/static/frontend/ and var/view_preprocessed and then run the static-content:deploy command again.
    – Ben Crook
    Feb 2, 2017 at 14:38
  • tried that, but also not working
    – user9839
    Feb 2, 2017 at 14:42

2 Answers 2

0

Try disabling static content versioning:

From your MySQL:

update core_config_data set value=0 where path='dev/static/sign';

Then from CLI:

php bin/magento cache:flush
php bin/magento setup:static-content:deploy

Sometimes, do not ask me why, it simply fails and disabling content versioning fixes it.

8
  • unfortunately this didn't help.
    – user9839
    Feb 2, 2017 at 13:58
  • error message on the browser says, "404 not found" and "Script from [URL] was blocked due to mime type mismatch" for the css and javascript files
    – user9839
    Feb 2, 2017 at 14:04
  • Is the URL correct? Can you paste here an example? Feb 2, 2017 at 14:19
  • sure, for example, mystore.com/pub/static/frontend/my/theme/ja_JP/css/styles-m.css
    – user9839
    Feb 2, 2017 at 14:34
  • Seems correct. Are you sure you have the same server config? Feb 2, 2017 at 14:34
0

Finally found the reason.

When you restore from backup of the filesystem_code, it doesn't create update folder at the root.

The previous magento installation which crashed still had the update folder, so I copied this folder to the newly restored folder.

Also make sure to have /pub/static.php, /pub/static/.htaccess and /var/.htaccess files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.