The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
.htaccess / geoIP: deny or forward per country
Hi folks,
I hope you all had a fabulous christmas time by now! I?ve run into a problem with my forums and the server. May be someone already has this one solved for his own forums - or knows a way, how to solve that. My site is been overruned by requests from the asian ans russian region now for weeks and causes the server to run permanently on very high loads and it?s slowing down the server, that it?s a pain in the a*se to visit the site. I would like to forward those bots to a honeypot on one of my other servers, instead of blocking them. So they can be reported automaticly to spamhouse.org and others. At the same time - for human visitors - I?ld like to forward visitors to language/origin-matching specific sites on my website. First: I can?t install a geoIP as apache module. I couldn?t figure out why - and I don?t want to do something nasty, that in the end is crashing the server - but I have a second best: I have PIWIK installed and with it a geoIP database as geoip_country.php file, running in a subdir. That works pretty fine for PIWIK. But how could I make use of this geoip-file in connection with a .htaccess so, that the origin of visitors/bots are checked by the .htaccess/geoIP and become deflected to another http target? I?ve already heard this shouldn?t be a problem (more like a rumor while a chit-chat), but - to be honest - I have no clue what has to be done, to make this happen. I?ld really appreciate, if someone could lend me a helping hand with that. Anyone....? |
#2
|
||||
|
||||
Try this neat tool, http://incredibill.me/htaccess-block-country-ips
I have read in some places though that doing this through .htaccess can slow the site down. Or you can try by blocking the country code. Code:
SetEnvIf CF-IPCountry CN BuzzOff=1 SetEnvIf CF-IPCountry RU BuzzOff=1 SetEnvIf CF-IPCountry IN BuzzOff=1 Order allow,deny Allow from all Deny from env=BuzzOff |
Благодарность от: | ||
Marv |
#3
|
|||
|
|||
Thanks for the input, Ozzy :up:
While thinking about that I`d to notice, that redirecting visitors from i.e. country en-US to /en-US would redirect even the GoogleBots, which would have an impact to all the other sites regarding SEO and SERPs and would make BigG stop to crawl those sites. Beside that I?m really not quite sure, wether Google would call this cloaking or not.. In the end I guess I should try to redirect human visitors by the language informations in the head of the browser: PHP Code:
--------------- Added [DATE]1388072353[/DATE] at [TIME]1388072353[/TIME] --------------- Quote:
I?m now adding country after country into that..and somehow it feels like becoming a racist while excluding all those countries. Does it work even the other way like this? PHP Code:
|
#4
|
||||
|
||||
TBH I am not sure, I have never tried it that way, but in theory it should work.
But As I stated before, the more countries that are blocked, the more resources are needed by the server. I had a partner on our server before, and he blocked a boat load of countries with the CSF firewall, and I did notice a performance hit. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|