V
V
Vitaliy Semyanchuk2014-05-28 12:06:28
Magento
Vitaliy Semyanchuk, 2014-05-28 12:06:28

Magento - how to restrict access to a website for certain countries?

Good afternoon.
We have a website that has the following architecture:
- website1 { -store1; -store2; -store3; -store4; -store5}
_________________________________________________________
- website 2 { -store1; -store2; -store3; -store4; -store5 }
________________________________________________________________
- website3 {-store1; -store2; -store3; -store4; -store5 }
And we want certain countries to have access to a certain website and all of its stores. For example:
Residents of the UK should have access to website1 and all its stores (store1, store2, store3, store4, store5), well, not have access to other websites ( website 2, website 3).
Residents of FR should be able to access website2 and all of its stores (store1, store2, store3, store4, store5), well not have access to other websites ( website 1, website 3).
Residents of DE should have access to website3 and all of its stores (store1, store2, store3, store4, store5), well not access to other websites ( website 1, website 2).
I tried installing the Geo Ip module, but it does not solve the problem, as it may restrict access of a certain country to the store only, but other stores of this website will not be available.
Maybe someone faced such a problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Stepanov, 2014-07-20
@sager77

In Nginx or Apache, set the website variable based on GeoIP , use
this variable in index.php to load the store you need

$website = isset($_SERVER['WEBSITE']) ? $_SERVER['WEBSITE'] : '';
Mage::run($website , 'website');

P
Puma Thailand, 2014-05-28
@opium

It is easier to implement on geoip in nginx for each store separately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question