Multistore views - add storecode to url - Master Config URL not working

Circum360NL

New member
Hi Support,

I enable multi store views on my Magento 2.2.7 website to provide multilanguage.

After enabling Add store code to urls my master config.xml is not loading anymore, because it is looking in the wrong URL.

The Master Config URL (PRO) is set as: /_config/config.xml which will be loaded as https://www.domain.com/_config/config.xml

But when I add the store code to the URL, I will get a 404 on the XML file, because it is trying to load as: https://www.domain.com/[storecode]/_config/config.xml
 

WebSupport

Active member
Hi and thanks for your message. Is the master xml file physically present at the updated location(s) as per your example?

Code:
https://www.domain.com/[storecode]/_config/config.xml

It's likely not there, so may be you can simply name them as something like this for each store config?

Code:
/_config/configEN.xml
/_config/configDE.xml
...etc
 

Circum360NL

New member
Hi,

I do not need extra config.xml files as the products in the storeviews are identical. It is only the language that is different.

The problem is that the value set in the backed for The Master Config URL (PRO) will be paste at the end of the URL.

In my situation I have a dutch view with storecode NL. It will generate the URL https://www.papegaaienzoo.nl/webshop/nl

The 'nl' is virtual. It is not a physical folder on the webserver.

When opening a productpage, the adhoc plugin will load the config in https://www.papegaaienzoo.nl/webshop/nl/_config/config.xml and this will end in a 404, because the config.xml cannot be found in that folder.
 

WebSupport

Active member
Please try removing this line on line 24 in \app\code\WebRotate360\ProductViewerAdHoc\view\frontend\templates\adhoc.phtml:

Code:
<?php $configPath = $helper->getBaseUrl() . $configPath; ?>

PS: you may also need to add /webshop to your Master config URL in the extension settings in admin to look like this, if your Magento actually lives under webshop folder:

Code:
/webshop/_config/config.xml
 

Circum360NL

New member
Thanks. Removing that line did the trick.

I have installed the version with composer, so I had to change adhoc.phtml under the vendor folder.

Will there be a version update coming for this one? Because, when I will update my system with composer I think it will overwrite my change on the file.
 
Top