I just move my site from a server to new server. Everything works well excepting switching language. The style cannot load after switching language. I have been stuck whole day. Please HELP! THANK YOU!
-
Welcome, the issue is that you have not deployed all static content for all your languages. if you have multiple languages you will need to deploy the static content for each of them like so "php bin/magento setup:static-content:deploy en_US en_GB de_DE nl_NL -f" minus quotes also the lanugages will need to match the languages avaible on your website– Dava GordonCommented Sep 11, 2019 at 7:41
2 Answers
Run below command from console to check language code
php bin/magento info:language:list
Check configured language code and run below command
php bin/magento setup:static-content:deploy -f en_US
php bin/magento cache:flush
chmod 777 -Rf var/cache var/page_cache var/view_preprocessed pub/static/frontend
Please use configured language code instead of en_US in above command
-
Hi thank you for your reply. I have run the above command with language code. But it is still not working. Is there any other command I need to run?– lancwlCommented Sep 11, 2019 at 5:46
-
you need to run the static content deplay command with language code
something like this
php bin/magento setup:static-content:deploy -f en_AU
php bin/magento cache:flush
php bin/magento cache:clean
chmod -R 777 var pub generated
en_Au is language code , you need to pass all your language code
-
-
update my answer please try that, and assign 777 permission to var pub and generator Commented Sep 11, 2019 at 7:01