Magento 2.3.0 - Multi Website Store URL Return 404 error












4














Workout :



1) Created new folder in Root folder named usa,



2) Copy index.php and .htaccess from root folder and moved to usa folder



3) Created symbolic links to usa folder, usa symbolic links are,




C:wampwwwfirst_store>mklink /d ..first_storeusaapp.app

C:wampwwwfirst_store>mklink /d ..first_storeusapub.pub

C:wampwwwfirst_store>mklink /d ..first_storeusalib.lib

C:wampwwwfirst_store>mklink /d ..first_storeusavar.var




4)usa index.php,



Set values for the MAGE_RUN_TYPE and MAGE_RUN_CODE



Open the index.php file under application root directory



Replacing this code: $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $_SERVER);

by these codes:

switch($_SERVER['HTTP_HOST']) {
case 'http://127.0.0.1:8080/first_store':
$mageRunCode = 'base';
$mageRunType = 'website';
break;
case 'http://127.0.0.1:8080/usa':
$mageRunCode = 'usa_website';
$mageRunType = 'website';
break;
}
$params = $_SERVER;
$params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
$params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;
$bootstrap = MagentoFrameworkAppBootstrap::create(BP, $params);


5) usa .htaccess file,



## enable rewrites

Options +FollowSymLinks
RewriteEngine on

SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_CODE=usa_website
SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_TYPE=website


6) Store configuration,



enter image description here



7) after run 127.0.0.1:8080/usa return 404 error , how can i solve this issue?










share|improve this question





























    4














    Workout :



    1) Created new folder in Root folder named usa,



    2) Copy index.php and .htaccess from root folder and moved to usa folder



    3) Created symbolic links to usa folder, usa symbolic links are,




    C:wampwwwfirst_store>mklink /d ..first_storeusaapp.app

    C:wampwwwfirst_store>mklink /d ..first_storeusapub.pub

    C:wampwwwfirst_store>mklink /d ..first_storeusalib.lib

    C:wampwwwfirst_store>mklink /d ..first_storeusavar.var




    4)usa index.php,



    Set values for the MAGE_RUN_TYPE and MAGE_RUN_CODE



    Open the index.php file under application root directory



    Replacing this code: $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $_SERVER);

    by these codes:

    switch($_SERVER['HTTP_HOST']) {
    case 'http://127.0.0.1:8080/first_store':
    $mageRunCode = 'base';
    $mageRunType = 'website';
    break;
    case 'http://127.0.0.1:8080/usa':
    $mageRunCode = 'usa_website';
    $mageRunType = 'website';
    break;
    }
    $params = $_SERVER;
    $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
    $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;
    $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $params);


    5) usa .htaccess file,



    ## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

    SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_CODE=usa_website
    SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_TYPE=website


    6) Store configuration,



    enter image description here



    7) after run 127.0.0.1:8080/usa return 404 error , how can i solve this issue?










    share|improve this question



























      4












      4








      4


      2





      Workout :



      1) Created new folder in Root folder named usa,



      2) Copy index.php and .htaccess from root folder and moved to usa folder



      3) Created symbolic links to usa folder, usa symbolic links are,




      C:wampwwwfirst_store>mklink /d ..first_storeusaapp.app

      C:wampwwwfirst_store>mklink /d ..first_storeusapub.pub

      C:wampwwwfirst_store>mklink /d ..first_storeusalib.lib

      C:wampwwwfirst_store>mklink /d ..first_storeusavar.var




      4)usa index.php,



      Set values for the MAGE_RUN_TYPE and MAGE_RUN_CODE



      Open the index.php file under application root directory



      Replacing this code: $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $_SERVER);

      by these codes:

      switch($_SERVER['HTTP_HOST']) {
      case 'http://127.0.0.1:8080/first_store':
      $mageRunCode = 'base';
      $mageRunType = 'website';
      break;
      case 'http://127.0.0.1:8080/usa':
      $mageRunCode = 'usa_website';
      $mageRunType = 'website';
      break;
      }
      $params = $_SERVER;
      $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
      $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;
      $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $params);


      5) usa .htaccess file,



      ## enable rewrites

      Options +FollowSymLinks
      RewriteEngine on

      SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_CODE=usa_website
      SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_TYPE=website


      6) Store configuration,



      enter image description here



      7) after run 127.0.0.1:8080/usa return 404 error , how can i solve this issue?










      share|improve this question















      Workout :



      1) Created new folder in Root folder named usa,



      2) Copy index.php and .htaccess from root folder and moved to usa folder



      3) Created symbolic links to usa folder, usa symbolic links are,




      C:wampwwwfirst_store>mklink /d ..first_storeusaapp.app

      C:wampwwwfirst_store>mklink /d ..first_storeusapub.pub

      C:wampwwwfirst_store>mklink /d ..first_storeusalib.lib

      C:wampwwwfirst_store>mklink /d ..first_storeusavar.var




      4)usa index.php,



      Set values for the MAGE_RUN_TYPE and MAGE_RUN_CODE



      Open the index.php file under application root directory



      Replacing this code: $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $_SERVER);

      by these codes:

      switch($_SERVER['HTTP_HOST']) {
      case 'http://127.0.0.1:8080/first_store':
      $mageRunCode = 'base';
      $mageRunType = 'website';
      break;
      case 'http://127.0.0.1:8080/usa':
      $mageRunCode = 'usa_website';
      $mageRunType = 'website';
      break;
      }
      $params = $_SERVER;
      $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
      $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;
      $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $params);


      5) usa .htaccess file,



      ## enable rewrites

      Options +FollowSymLinks
      RewriteEngine on

      SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_CODE=usa_website
      SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_TYPE=website


      6) Store configuration,



      enter image description here



      7) after run 127.0.0.1:8080/usa return 404 error , how can i solve this issue?







      magento2.3 localhost multi-website wamp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 18 hours ago

























      asked yesterday









      zus

      81116




      81116






















          1 Answer
          1






          active

          oldest

          votes


















          2















          1. Check that you have enabled To include the store code in URLs as explained in user guide here.


          2. Try to either the .htaccess or index.php override.
            So you can remove,
            $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
            $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;




            • References:


            • devdocs.magento.com/v2.3/config-guide/multi-site/ms_apache.html


            • devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html#multi-storecode-baseurl

            • docs.magento.com/m2/ce/user_guide/stores/store-urls.html








          share|improve this answer





















          • After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
            – zus
            22 hours ago










          • @zus Have you included the store code in URLs from admin config ?
            – Milind Singh
            21 hours ago










          • Also can you add first_store in apache conf
            – Milind Singh
            21 hours ago










          • I just want to know how can i add both @Milind Singh
            – zus
            21 hours ago












          • can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
            – zus
            21 hours ago













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256694%2fmagento-2-3-0-multi-website-store-url-return-404-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2















          1. Check that you have enabled To include the store code in URLs as explained in user guide here.


          2. Try to either the .htaccess or index.php override.
            So you can remove,
            $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
            $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;




            • References:


            • devdocs.magento.com/v2.3/config-guide/multi-site/ms_apache.html


            • devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html#multi-storecode-baseurl

            • docs.magento.com/m2/ce/user_guide/stores/store-urls.html








          share|improve this answer





















          • After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
            – zus
            22 hours ago










          • @zus Have you included the store code in URLs from admin config ?
            – Milind Singh
            21 hours ago










          • Also can you add first_store in apache conf
            – Milind Singh
            21 hours ago










          • I just want to know how can i add both @Milind Singh
            – zus
            21 hours ago












          • can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
            – zus
            21 hours ago


















          2















          1. Check that you have enabled To include the store code in URLs as explained in user guide here.


          2. Try to either the .htaccess or index.php override.
            So you can remove,
            $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
            $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;




            • References:


            • devdocs.magento.com/v2.3/config-guide/multi-site/ms_apache.html


            • devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html#multi-storecode-baseurl

            • docs.magento.com/m2/ce/user_guide/stores/store-urls.html








          share|improve this answer





















          • After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
            – zus
            22 hours ago










          • @zus Have you included the store code in URLs from admin config ?
            – Milind Singh
            21 hours ago










          • Also can you add first_store in apache conf
            – Milind Singh
            21 hours ago










          • I just want to know how can i add both @Milind Singh
            – zus
            21 hours ago












          • can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
            – zus
            21 hours ago
















          2












          2








          2







          1. Check that you have enabled To include the store code in URLs as explained in user guide here.


          2. Try to either the .htaccess or index.php override.
            So you can remove,
            $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
            $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;




            • References:


            • devdocs.magento.com/v2.3/config-guide/multi-site/ms_apache.html


            • devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html#multi-storecode-baseurl

            • docs.magento.com/m2/ce/user_guide/stores/store-urls.html








          share|improve this answer













          1. Check that you have enabled To include the store code in URLs as explained in user guide here.


          2. Try to either the .htaccess or index.php override.
            So you can remove,
            $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode;
            $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType;




            • References:


            • devdocs.magento.com/v2.3/config-guide/multi-site/ms_apache.html


            • devdocs.magento.com/guides/v2.3/config-guide/multi-site/ms_websites.html#multi-storecode-baseurl

            • docs.magento.com/m2/ce/user_guide/stores/store-urls.html









          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 22 hours ago









          Milind Singh

          603115




          603115












          • After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
            – zus
            22 hours ago










          • @zus Have you included the store code in URLs from admin config ?
            – Milind Singh
            21 hours ago










          • Also can you add first_store in apache conf
            – Milind Singh
            21 hours ago










          • I just want to know how can i add both @Milind Singh
            – zus
            21 hours ago












          • can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
            – zus
            21 hours ago




















          • After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
            – zus
            22 hours ago










          • @zus Have you included the store code in URLs from admin config ?
            – Milind Singh
            21 hours ago










          • Also can you add first_store in apache conf
            – Milind Singh
            21 hours ago










          • I just want to know how can i add both @Milind Singh
            – zus
            21 hours ago












          • can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
            – zus
            21 hours ago


















          After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
          – zus
          22 hours ago




          After remove $params[MagentoStoreModelStoreManager::PARAM_RUN_CODE] = $mageRunCode; $params[MagentoStoreModelStoreManager::PARAM_RUN_TYPE] = $mageRunType; still getting same error @Milind Singh
          – zus
          22 hours ago












          @zus Have you included the store code in URLs from admin config ?
          – Milind Singh
          21 hours ago




          @zus Have you included the store code in URLs from admin config ?
          – Milind Singh
          21 hours ago












          Also can you add first_store in apache conf
          – Milind Singh
          21 hours ago




          Also can you add first_store in apache conf
          – Milind Singh
          21 hours ago












          I just want to know how can i add both @Milind Singh
          – zus
          21 hours ago






          I just want to know how can i add both @Milind Singh
          – zus
          21 hours ago














          can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
          – zus
          21 hours ago






          can you pls join with chat.stackexchange.com/rooms/87829/… @Milind Singh
          – zus
          21 hours ago




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256694%2fmagento-2-3-0-multi-website-store-url-return-404-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1300-talet

          1300-talet

          Display a custom attribute below product name in the front-end Magento 1.9.3.8