0

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
    Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
    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? – Liam McArthur Feb 28 '18 at 16:57
  • From which path css and js are loading ? Check if . htaccess file is there in pub/static folder. – Kalyan Chakravarthi V Feb 28 '18 at 17:05
  • @LiamMcArthur, edited my question. – Ruben Perdigao Feb 28 '18 at 17:16
  • @KalyanChakravarthiV , the .htacess is there. – Ruben Perdigao Feb 28 '18 at 17:17
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.

| improve this answer | |

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.