Hi guys I come here to get some light.. I'm gonna explain what I want to do.

I want to make a base Magento 2 platform ready to be expansive with more Websites focused on stores.

Each websites will have multilanguage option,

  • website1.es
  • website1.es/en/
  • website1.es/pt/

Another website...

  • website2.es
  • website2.es/en/
  • website2.es/pt/
  • ...

I added in root .htaccess the following code:

SetEnvIf Host www\.website2\.es MAGE_RUN_CODE=**websitecode**
SetEnvIf Host www\.website2\.es MAGE_RUN_TYPE=website
SetEnvIf Host ^website2\.es MAGE_RUN_CODE=**websitecode**
SetEnvIf Host ^website2\.es MAGE_RUN_TYPE=website

The problem is that I do not get how to use folder structure for store views. I tried to enable Add Store Code to Urls but Store views folders in URL are like en_1, en_2 and they are not url friendly... that's because store views code are unique.

I tried to change Base URL, Base Link URL etc options in Configuration and CSS and media loads well but the funtionality of the website is not correctly (loop of loading php and strange things)

  • Base URL: website2.es/en/
  • Base Link URL: website2.es/en/
  • Base URL for Static View Files: website2.es/pub/static/
  • Base URL for User Media Files: website2.es/pub/media/

But I don't discard to work in the future with local domains for different projects focused more on brands (brand3.es, brand3.fr, brand3.com ...) I comment this to get you in the case.

So I would know what do you recommend to do to take flexibility and make for now accessible to a store view by folder URL. Thanks!

Why my post is not duplicated. The suggested solution is for the same domain with multiple magento websites. My request is different and propose a different flexibility. Mine is Magento2 and their 1.x

  • cause your base now moved so per every subfolder you must have proper rewrite, no need any actual folders on the server, never tried that with apache, but something like this: SetEnvIf Request_URI "^pt/.*" MAGE_RUN_CODE=D1_es_pt httpd.apache.org/docs/current/mod/mod_setenvif.html – MagenX Jul 23 '16 at 20:40
  • 1
    Possible duplicate of Different storeviews or websites in subfolders – MagenX Jul 23 '16 at 20:41
  • Look for the "languagefolders" answer in the linked duplicate. – Fabian Schmengler Jul 25 '16 at 6:23
  • @MagenX Thanks a lot I'm gonna try it, but how recognize that request_URI the domain ? Maybe I sould use "^website2.es/pt/."? – Sergio Bernal Jul 25 '16 at 8:12
  • @fschmengler Hi I have read it but I saw that they were talking about Enterprise Edition. Anyway I have been expected that their solution was a little tricky and not very stable (I don't want to start duplicating files...) – Sergio Bernal Jul 25 '16 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.