How to allow access only within the country

I found this website to create .htaccess to block access from a specific country.

The problem is that I want to allow access only within Norway. If I use this service, the list will be very long, since I have to specify all the IP addresses of the country.

Is there any way to allow domestic access, my business is Norway?

+5
source share
2 answers

Change all occurrences of "deny" to allow, and disable all occurrences of "allow". Then move the “discard all” condition at the end to the top of the list.

eg.

<Limit GET HEAD POST>
order allow,deny
deny from 41.205.32.0/19
deny from .... 
allow from all
</LIMIT>

becomes

<Limit GET HEAD POST>
order deny,allow
deny from all
allow from 41.205.32.0/19
allow from ....
</LIMIT>

There are good tutorials on .htaccess .

+4

geoip, . http://www.maxmind.com/app/mod_geoip apache, , , , .

0

All Articles