0

I am creating a second store in the same website, for that i followed blow link https://magefan.com/blog/create-multiple-stores-in-magento-2.

After Created a new store it's looking as below. enter image description here

Then in that store I changed the base url and base secure url as like below enter image description here

Now in my home page I've got the menu in footer section to view the second store. enter image description here

But while view the second store i got the page as like below. I've ran all the magento commands also, is there need to do any other configuration or something else, your better idea will help me more.

enter image description here

2 Answers 2

0

I guess the issue is related to your second store base url configuration

You have 4 options to manage few stores under the same website:

  1. Cookie based logic (default). You need to have the same domain and path for all website stores. The system routes to store by cookie or request parameter.

  2. Store Code in URL. You can enable to add store code in URL in Stores -> Configuration. In this case you also need to have same domain and path, but your code will be included in URL and the system routes to store by request URL path.

  3. Custom domain (subdomain) configuration. You need to properly configure subdomain and pass MAGE_RUN_TYPE and MAGE_RUN_CODE environment variables with server configuration. In this case the system routes to store by environment variable.

  4. Custom directory or server URL Rewrite. You can create custom directory under your pub directory and place custom index.php and specify required store with environment variables (the same like in 3rd option) or create rewrite rule on server level and route to index.php with needed environment variables.

Important: The pub directory should be the public root of your application and should not be included in URL.

When you want to use 1st or 2nd option you will have the same shared static and media resources (the same path) for all stores under website.

0
You need to check the URL in the index.php inside pub.
Check the URL In the core_config_table.
If you are using the Nginx then you need to create separate hosts for that site.
Check the pub Media folder.

I think this resolves your issue.

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.