I have two store views, I changed one of them from wesbitetest.com to websitetest.com/fr-ca/ but the front end didn't load the js and CSS files as expected, and the URL becomes websitetest.com/fr-ca/?___store=fr_ca instead of websitetest.com/fr-ca/
2 Answers
Run these commands on your server to make sure that everything is deployed well after that change.
alias mage="php -d memory_limit=-1 -f bin/magento"
mage setup:upgrade &&
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
mage cache:flush &&
mage indexer:reindex &
mage setup:static-content:deploy -j 10 -f en_US fr_CA
mage setup:di:compile
mage maintenance:disable
-
could you please explain to me this mage setup:static-content:deploy -j 10 -f en_US fr_CA in my case i have fr-ca and en-a and another website that has one store view en-us .. Mar 30, 2018 at 18:20
-
This command will deploy the static files for both languages, it won't set any configuration, you can run this commands even if you haven't used en_US ou fr_CA. Apr 2, 2018 at 14:03
We need more details to help you efficiently, such as what have you already tried, any errors, any permissions issues, etc.
In the meantime, you can follow standard theme debugging steps:
Make sure your theme settings are scoped correctly, under
Content -> Design -> Configuration
In addition, you will want to clear our your pub/static/frontend/* and var/view_preprocessed/* directories.
rm -rf pub/static/frontend/* var/view_preprocessed/*
You should then try as Abdul suggested: compile, deploy static content, and clear caches.
-
it broke the whole front end in all stores when i cleaned and deployed, with these errors: efused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. require.min.js Failed to load resource: the server responded with a status of 404 (Not Found) (index):1 Refused to execute script from 'dev4.wetag.ca/pub/static/version1522434789/frontend/Magento/…' because its MIME type ('text/htm Mar 30, 2018 at 18:56
pub/static
andvar/view_preprocessed
then launch this command :php bin/magento setup:static-content:deploy fr_CA -f
if you are usingfr_CA
language otherwise replace it with your local language code`