I have created multiple website from magento admin, also as per the magento devdocs I've followed the instructions for multi website sub-folder architecture.

However its throwing me below error. also I found that my default magento website throwing me the same error after processed with multi-website scenario. click here for error info

Also I've followed this link


1 Answer 1

  1. Create a Websites and it's relevant Store and StoreView from Admin > Stores > All Stores
  2. Go to Stores > Configuration, Select website which you have created. Then Go to Web and change both Base URLs & Base URLs (Secure)

    For example : e.g. Base URL: xyz.com (Main website url keep as it is) Base Link URL: {{unsecure_base_url}}ch/

    Here, ch is a sub directory folder which needs to create under your magento root folder

  3. Create a sub directory folder, then copy index.php & .htaccess from root

  4. Open index.php replace everything with the code bellow:

    require realpath(__DIR__) . '/../app/bootstrap.php';
    $params = $_SERVER;
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'ch_website'; 
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; 
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
    $app = $bootstrap->createApplication('Magento\Framework\App\Http');

    ch_website is a website code.

  • Thanks bro. It helped me. i made small mistakes in url. Thank you so much Commented Aug 1, 2018 at 9:26
  • Thanks, It helped me a lot. Commented Jun 3, 2019 at 11:04
  • @TejaBhagavanKollepara I am getting issue, could you pls help me?
    – zus
    Commented Jun 30, 2020 at 2:57

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.