3

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

5
  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');
    $bootstrap->run($app);
    

    ch_website is a website code.

  • Thanks bro. It helped me. i made small mistakes in url. Thank you so much – Teja Bhagavan Kollepara Aug 1 '18 at 9:26
  • Thanks, It helped me a lot. – Virang Jethva Jun 3 at 11:04

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.