Jump to content

Restrict access from a country


Recommended Posts

I am trying to restrict access to my shop from a particular country. I downloaded the geo.dat file given in the BO in geolocation. I extracted it and uploaded it to the location mentioned. Lastly I unchecked the country from the list of countries given in geolocation. But it is not working. Coz the country to be restricted is the one where I am currently based. Kindly help please.

Link to comment
Share on other sites

Hi - I had set up as this: For restricted countries - Cannot see my catalogue;

For other countries - All options are available.

 

Well after downloading the geoip file and placing it in tools/geoip/directory. But it shows the message: Geolocation database is unavailable.

Please guide me with the steps to be done to successfully setup this module

Link to comment
Share on other sites

  • 4 months later...

Please note:  most issues testing with Geo Localization..

 

you must 'clear your browser cookie for your shop, or all cookies) prior to starting a test and when changing countries you are testkng with.

 

Otherwise PrestaShop will use what is in the existing country.  currency/language/country etc.

 

for anyone that is into localization and wants to save loads of time, here is a 'very' reasonably priced PrestaShop module that simulates a visitors view of your shop by 'country' or 'ip'.  

 

http://www.prestashop.com/forums/topic/279119-module-geo-targeting-localization-country-or-ip-simulator-pro/

 

happy localizing

Link to comment
Share on other sites

  • 2 years later...

Hi, I should also block all IP addresses of a particular nation, how can I do?I should also block all IP addresses of a particular nation, how can I do?

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I should also block all IP addresses of a particular nation, how can I do?I should also block all IP addresses of a particular nation, how can I do?

 

 

Download Country's IP and copy all IP's - http://www.ip2location.com

 

Open .htaccess file

 

At last of .htaccess file Add a line (Last means Last  and do not write anywhere between the other code else it will not gonna workkk ! )

 

ErrorDocument 404 /Error404.html

 

Paste all the restricted IP's from provided Website...

 

deny from 1.38.0.0/15

deny from 1.186.0.0/15

deny from 5.56.18.0/24

etc etc .. it can me 1000+

 

Save your .htaccess File

 

Create another Error404.html file in your root folder (it may be plain text or you can modify its content so that user will get nice Error Page for Unauthorized access)

 

If you have any problem you can write me

 

Cheersssssssssssss !!!!

 

BEST Place to Live in : 127.0.0.1

Edited by sinnights (see edit history)
Link to comment
Share on other sites

ya I've got the code. I pasted it in the .htaccess file and saved it. Nothing happens...?

 

you just Need to add extra file in your Root Directory - anyfilename.html

 

Open .htaccess

 

Write a line at last - do not write anywhere else it will not gonna work !

 

ErrorDocument 404 /anyfilename.html

 

All IP's range of addresses which you copy from Internet

 

Save and check your website...

 

:ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r:

.......with the help of PROXY

Link to comment
Share on other sites

×
×
  • Create New...