banning a country from my site

Status
Not open for further replies.

mbrowne12589

New Member
Messages
10
Reaction score
0
Points
0
I want to ban a country from my site. Do i do this or do you have to? also, can i switch this feature on and off myself once it is setup? thank you
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
To ban a country from your site, go to http://www.countryipblocks.net/ and in the right column choose ".htaccess deny" and the country you wish to block.
Then copy/paste the result into your .htaccess file in public_html. To unblock it remove those entries from .htaccess

(Disclaimer: the linked website is in no way endorsed by or affiliated with x10Hosting)
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Don't think that will work with the load balancing set up. allow/deny only sees the IP of the balancer.

EDIT/ADD:

Code to block one IP, tested and works on Chopin.

Code:
RewriteCond %{HTTP:X-Forwarded-For}     ^130\.65\.11\.68$  
RewriteRule ^(.*)$  you-are-not-welcomed-here.html [L]
 
Last edited:
Status
Not open for further replies.
Top