问题
Is it possible to setup Open Cart as a multi-store installation over different domain names?
I have a OC setup on domain www.xxx.xx. The official documentation explains how to setup OC on a subdomain (i.e. subdomain.xxx.xx). That is OK and we can do that. However we need ot have the stores running on completely different domains. That means i.e. the multi-store clone installed on subdomain.xxx.xx accessible through www.somedomain.xx.
Now I am aware that I could redirect the TLD somedomain.xx into the subdomain installation. However that is not really what we need. We need for it to act as completely different stores.
Question is how do I do this? And is this even possible? (as I can imagine that there might be some problems with sessions and cookies set in such an environment? besides possible other issues...)
(we have our own servers with access to root so our options are not limited with hosting accounts)
回答1:
If You really need to have the multi-domain multi-store, You can achieve it by setting up the sub-domain multi-store first and then making the domains to be aliases to this sub-domains, e.g.
- Default Store -> http://www.domain.com
- Store 1 -> http://sub1.domain.com
- Store 2 -> http://sub2.domain.com
- Store 3 -> http://sub3.domain.com
and then
- http://www.domain1.com -> http://sub1.domain.com
- http://www.domain2.com -> http://sub2.domain.com
- http://www.domain3.com -> http://sub3.domain.com
Though the Store 1 could be accessed now by both http://sub1.domain.com and http://www.domain1.com it is up to marketing to deliver only http://www.domain1.com URL. Perhaps some other .htaccess
restrictions/redirect from direct access to http://sub1.domain.com may be set but this is not necessary at all. Using these aliases to sub-domains You should be able to preserve all the functionality of multi-store on sub-domains...
回答2:
It's possible to setup opencart multi stores with different domains like domain1.com, domain2.com etc.
If we setup multi-stores as subdomains, then:
- By default the same cart will be shared for all stores.
- Customer won't be asked to login if he goes to another store. etc.
However for you the above cases will not happen as you're using different domains. Since you need the stores to be independent, it'll be better to assign separate customer groups for each store - so that the customer will be asked to sign up for each store.
Eventhough the stores are independent all stores share the same admin section, that is even if we login using domain2.com/admin
- it will get redirected to domain1.com/admin
after login.
来源:https://stackoverflow.com/questions/20314105/opencart-mult-store-setup-over-different-domains