Sergio
Sergio

Reputation: 628

How to allow access for only United Kingdom and a second country

I'd like to restrict the allowed IPs to UK and a second country, say Brazil or whatever other one.

I did find an answer, but the link to the tutorials are not working.

Any help will be appreciated.

Cheers

Upvotes: 1

Views: 1381

Answers (1)

Rakesh patanga
Rakesh patanga

Reputation: 822

The below .htaccess can helpyou.

<Limit GET HEAD POST>
order deny,allow
deny from all
allow from 11.305.12.0/29
allow from ....
</LIMIT>

Just give ipaddess ranges of UK & Second country in the allow from part

Source:

Updated answer

My best idea would be.To handle it in the application level rather than webserver level.you can easily get country name using the ip-address which can get from webrequst If its UK or second country then you can let him see you main page or else you can redirect to a page that says the access protection available to the countris

Upvotes: 1

Related Questions