I would like to setup multi store. I have two domains:

  • example.com
  • french.example.com

I use this article: https://www.simicart.com/blog/magento-2-multiple-stores-domains/ and created:

French (Code: french) 
Main Website (Code: base) 

French (Code: french)
Main Website Store (Code: main_website_store) 

Store views:
French (Code: french) 
Default Store View (Code: default) 

Base URLs (Store View for Default config) is http://example.com. Base URLs (Store View for French) is http://french.example.com.

It works correct!

But, I would like to use Base URL "example.com" for both domains!

I mean, that


have to return "example.com" for store view French as well!

Now it returns "french.example.com" for French and "example.com" for Default.

Is it possible to setup this way?

2 Answers 2


I've tried to set up another way. I have entered for both domains Base URLs "http://example.com".

So, url for default sore view is:


url for french store view is:


But, I cannot setup, that http://example.com/french/ will redirected to http://french.example.com/


Make a Directory on root with name french and create file index.php place below code in this file.

 * Application entry point
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.

try {
    require __DIR__ . '/../app/bootstrap.php';
} catch (\Exception $e) {
    echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
    <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
        <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
        Autoload error</h3>

$params = $_SERVER; 
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'french'; //Webite code as same in admin panel which we entered in step 2 
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; 
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); 
/** @var \Magento\Framework\App\Http $app */ 
$app = $bootstrap->createApplication('Magento\Framework\App\Http'); 
  • Thank you. I've tried your solution, but I still have this issue.
    – PHPer
    Commented Oct 30, 2019 at 7:34
  • did you place your code in html directory. Commented Oct 30, 2019 at 10:12
  • yes, I placed it to 'french/index.php'
    – PHPer
    Commented Oct 30, 2019 at 10:41
  • strange i am using it with similar code. I have a multi website each with diff name. check your base urls in core_config_data table Commented Oct 30, 2019 at 10:52

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.