WebSite X5Help Center

 
Michel M.
Michel M.
User

Site restrictions  en

Autore: Michel M.
Visite 1241, Followers 1, Condiviso 0  

Dear Sirs

Looking to get help plese.

As we are whoesaler serve only London , is there any way to restrect clients of purchase if they are outside london?

Hope to get help soon as it's realy an important matter

Kind regards

Postato il
2 RISPOSTE - 2 UTILI
Claudio D.
Claudio D.
Moderator
Utente del mese IT

I hope you are on linux host...
if yes, you can do it by putting in the htaccess on your host
of instructions to allow only people from London to visit your site or your store folders , only.
everyone else you block them .
Or , better yet, with all pages in php,
you always redirect based on the visitor's IP ...
take a cue from here:
https://stackoverflow.com/questions/29088644/php-redirect-based-on-ip-addresses

Leggi di più
Postato il da Claudio D.
Stiac Engineering
Stiac Engineering
User

Interesting topic!

If instead of PHP you wanted to use JavaScript, you could use code that actually takes advantage of geographic location if you wanted, using actual GPS data you could use this code https://www.gebher.com/blog/index.php?redirect-based-on-geolocation

The operation is approximately simple, i.e. if the user is not within a kilometer radius, modifiable by us and from the headquarters of our business, he is redirected to an alert page to inform him appropriately.

I hope it can be useful.

Leggi di più
Postato il da Stiac Engineering