Monday, April 23, 2012

How to Create different store view with different sub-domain in magento

How to create store view


1. Go to admin then select tab System->manage stores
2.Click create store view and complete the form and save store view
then you will be able to see in the list.

How to Change the Base URL for each Store view


1.. Go to admin then select tab System->configuration
2.On the left side of the page General under that select web but before that you have to change the Current Configuration Scope to your store view name
3. Edit the base url to you subdomain(eg: http://en.yourdomain.com)
4.click save config.

How to change .htaccess for redirecting to store view if you call the subdomain


1.Your .htaccess file is at the root folder of magento.
2.Search for "RewriteEngine on" word  in .htaccess file and write the code below it

RewriteCond %{HTTP_HOST} ^en.yourdomain.com
RewriteRule ^ - [E=MAGE_RUN_CODE:english]
RewriteCond %{HTTP_HOST} ^fr. yourdomain .com
RewriteRule ^ - [E=MAGE_RUN_CODE:french]

 then save the .htaccess file and try to clear all cache and browsing history from your browser as well as from magento

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well.this was actually what i was looking for,and i am glad to came here!
    magento development company in bangalore 

    ReplyDelete