Change Store View by Referer URL
Did you know that you can load a store view depending on the website referer you came from?
For example if I wanted to load my UK store view on mywebsitesshop.com because my customer visited from mywebsite.co.uk I could do this easily by adding a little piece of htaccess code.
What you’ll need is this:
SetEnvIf Referer mywebsite.co MAGE_RUN_CODE=myuksitecode SetEnvIf Referer mywebsite.co MAGE_RUN_TYPE=store
Put that at the top of your htaccess file and make sure that “myuksitecode” matches up with the identifier you have for your store view.
Thanks for visiting the Magento Blog here at Ecommerce Web Design.

Thank you for the tip, but it will not work like this.
Proper code will be
SetEnvIf Referer www\.mywebsite\.co MAGE_RUN_CODE=myuksitecode
SetEnvIf Referer www\.mywebsite\.co MAGE_RUN_TYPE=store
SetEnvIf Referer ^mywebsite\.co MAGE_RUN_CODE=myuksitecode
SetEnvIf Referer ^mywebsite\.co MAGE_RUN_TYPE=store