.htaccess - How can I use different urls for different store views in magento? -


i have different store views in magento shop different languages. can access them through

www.serverdomain.from.my.hoster.tld/langkey/ 

the langkeys codes of different store views , enabled "add store code urls".

now, want use following registered domains without editing index.php

www.myshopsite.langkey 

for example:

www.myshopsite.de www.myshopsite.en www.myshopsite.com 

for tried set mage_run_code , mage_run_type via htaccess till realized used different stores , not different store views.

since configured base url german store view can access via

www.myshopsite.de/de/ 

now trying internally redirect www.myshopsite.de/ www.myshopsite.de/de/ remove trailing store view code.

thats try ended in redirect www.myshopsite.de/en/ , internal server error

rewriteengine on rewriterule ^$ de/$1 [l] rewriterule ^(.*) de/$1 [l] 

i sorry if fault obvious.

you can try @ bottom of .htaccess file located in magento root directory.

setenvif host www\.myshopsite.\.$ mage_run_code=$1 

the mage_run_code variable magento store view. set store view code set under system > manage stores > store view

i've done quite bit of these configurations know server environment setup (apache etc) may differ, , using setenvif in .htaccess may not work. if case, may better off inserting bit of code index.php achieves results looking for.

yes, it's modifying core file, given scenario might more stable have php handle store variable mapping rather apache.


Comments