i migrated magento 2 to a new server, but the problem is that, my css and javascript does not load, i tried:

  • removing the cache,
  • php bin/magento setup:static-content:deploy,

  • Opened up app/etc/di.xml find the path
    and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

enter image description here

enter image description here

  • Is the new server using the same environment as previously (PHP version etc)? It's likely that this is a permission issue. Is there anything in your error log files, or any errors in the browser console? Commented Feb 28, 2018 at 16:57
  • From which path css and js are loading ? Check if . htaccess file is there in pub/static folder. Commented Feb 28, 2018 at 17:05
  • @LiamMcArthur, edited my question. Commented Feb 28, 2018 at 17:16
  • @KalyanChakravarthiV , the .htacess is there. Commented Feb 28, 2018 at 17:17

1 Answer 1


I checked the source of the home page, it looks like CSS and js files didn't generate or permission issue is there.

To make sure that they are generating

  • Take a backup of htaccess file in pub/static please remove static folder and run the static content deploy command

  • Keep htaccess in pub/static

  • Run static content deploy command

  • give 777 permission to the pub folder.

    It should resolve the issue.


Your Answer

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

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