0

i have setup multi website in magento 2.3.4 on single Domain with setting - Add Store Code to Urls

enter image description here

my website URLs are like below now 1: example.com/in 2: example.com/us

i want to call images from media folder , earlier i use below code that is not working after multi store

Earlier code : getBaseUrl(); ?>media/abc.png

Issue : after muti store setup my image URL becomes like example.com/us/media/abc.png and this causes issue with images ,

Please help way to fix it

0

try to get the base url based on the store, something like,

* @var \Magento\Store\Model\StoreManagerInterface $this->_storeManager
*/

$this->_storeManager->getStore()->getBaseUrl();

In database you should have a base url for each store ID correct? In core_config_data table, in column path search this web/secure/base_url and check if appears 2 results with different scopes. Hope it helps :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.