Hi,
I have set up a multi store.
en.xxxx.com and new.xxxx.com
new.xxxx.com is the main store and it is ok
es.xxxx.com the second one and it doesn't work because something doesn't load.
In the folder is I have the index.php changed.
The icons don't load and I can't put anything on the cart.
Images:
https://ibb.co/ZhGD1bS https://ibb.co/MckQwVW
How can I solve it?
<?php require realpath(__DIR__) . '/../new/app/bootstrap.php'; // path of root magento bootstrap.php $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'es_ES'; // change this with the code you chose in step. 4 $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; // store or website $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); $app = $bootstrap->createApplication('Magento\Framework\App\Http'); $bootstrap->run($app);
Solved! Go to Solution.
please remove the current symlink and add new
to remove
rm pub
NOTE: do not add a trailing slash while removing the symlink
Now create a new symlink using :
ln -s ../pub
its probably a CORS issue
kindly check that by opening the console in the browser.
if the issue is there then check and update the URL for static content for the 2nd website.
the domain should be the same to resolve the CORS issue
or you can also by adding this into .htaccess
Header add Access-Control-Allow-Origin "*"
Thanks for answering.
Yes putting the line in the .htaccess the icons are seen, but the add to cart and other javascript functionalities still do not work.
At site 1 everything is working.
Do you know what I can do more?
Hello @Perla Simeone
Did you try after running below commands :
php bin/magento setup:static-content:deploy -f php bin/magento c:f
Hope it helps !
any JS errors are there in the browser console?
can you share a screenshot of that?
Hi,
this is a screen the console.
But not view anithing very important...
https://www.es.revocompany.com/found-mr-ltd.html
https://www.new.revocompany.com/found-mr-ltd.html
login into Admin
navigate to
Store -> Configuration -> General -> Web
change the store to es &
check Secure Base URL for Static View Files
this should be from the www.es.revocompany.com domain
Also, you need to create a symlink to the static & media folder if you have a different folder setup for es store.
Note: Your website is not running from the pub folder. you should update DocumentRoot to the pub folder.
Hi,
I can't make it work
Now I don't get the css
https://ibb.co/5cZ1W07
https://ibb.co/hZx4jwb
https://www.es.revocompany.com/
https://www.new.revocompany.com/
can you share a screenshot for the folder structure?
for ES store?
are you using the same folder for both websites or different?
if different then, create a symlink for the pub folder into the ES store's folder.
Hi,
there are two folders one for new where the magento is and one for es and I have the symlinks.
So it must be okay? but I can't make it work.