I have 2 sites running on Magento 1.8.1 and each site has a different domain. I would like to have 3 store views for each site.
Each site will have 3 languages.
Each language will use the same TLD. Languages will be denoted by using /en/ in the url.
Here's what I'm trying to get it to look like:
http:website-a.com/en/product.html
http:website-a.com/es/product.html
http:website-a.com/fr/product.html
http:website-b.com/en/product.html
http:website-b.com/es/product.html
http:website-b.com/fr/product.html
I can easily achieve this on only one site by simply using the "Add Store Code to Urls" option in Magento Admin. However, Magento will not allow me to use the same store code twice. Furthermore, If I decide to run a third website that only has one language, I wouldn't want to insert any store code.
e.g.(http:website-c.com/product.html)
but unfortunately
the "Add Store Code to Urls" option is global and cannot be changed on a per-site or per-store basis.
So, how would I go about setting this up to work right? Should I use unique values for each store view and then do rewrites? How would that work? I don't really understand how to write rewrite rules.
Or could I do something in index.php?
Any help is appreciated :)
MAGE_RUN_CODE
env variable base on theHTTP_HOST
andREQUEST_URI
.