0

enter image description here

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/

5
  • Any errors in the console?
    – Condor
    Commented Mar 30, 2018 at 12:53
  • Run commands:php bin/magento setup:di:compile, php bin/magento setup:static-content:deploy, php bin/magento cache:clean, php bin/magento cache:flush, & After give permission var & pub folder
    – Abdul
    Commented Mar 30, 2018 at 13:17
  • @bramulous yes please see the screenshot I added to the original post Commented Mar 30, 2018 at 17:51
  • Clean the content of pub/static and var/view_preprocessed then launch this command : php bin/magento setup:static-content:deploy fr_CA -f if you are using fr_CA language otherwise replace it with your local language code`
    – PЯINCƎ
    Commented Mar 30, 2018 at 17:55
  • the thing is if i do Stores->Configuration>"Add store code to URLS"->yes it will add the store code which is fr_ca and not fr-ca, it only accepts the underscore :s Commented Mar 30, 2018 at 18:01

2 Answers 2

1

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
2
  • 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 .. Commented 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. Commented Apr 2, 2018 at 14:03
0

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.

1
  • 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 Commented Mar 30, 2018 at 18:56

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.