|
#1
|
|||
|
|||
|
It would be fantastic to have an easy to use tool to block entire nations from accessing our sites!
Let's face it, we all have traffic from parts of the world that is just useless and costs us bandwidth. And sometimes it is worse than usless.... It's a pain in the buttocks !!! For example I have had problems with scam and con artists from Albania and several African nations. I can't sell to these nations and with my business model I can't see how I can do business with them in the future. So locking out Albania and Africa would be an ideal option for me. So how about it ? |
|
#2
|
||||
|
||||
|
You can use .htaccess in other ways to block countries-- do it by IP range:
Code:
order allow,deny deny from 43.23.23.23 allow from all
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#3
|
|||
|
|||
|
Quote:
The list of IP addresses could be huge; I believe China is about to overtake the US, but either way, the list is very big. And as you know, IP address blocks are de-allocated and re-allocated fairly frequently. On that note... Even the smallest countries are going to have a very large range and doing it your way might mean I also block nations I don't want to block. Denmark for example has apx. 5.5 million people. If I simply deny access to anyone with an IP starting with 43.23. I might end up locking out a portion of Sweeden, Germany or even Norway. |
|
#4
|
|||
|
|||
|
The standard way of blocking countries is to load the free geoip database from maxmind into MySQL and then write a geoip PHP script. Thatīs best working method of blocking at the country level. However as people in the UK (just an example) may actually log into their ISP in the US the blocking wonīt be perfect, but itīs as close as it gets.
__________________
A review directory of cheap web hosting providers
Read my Hostgator review before you sign up Listings of the cheapest web hosting providers |
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
|||
|
|||
|
Have you considered that these hits could be valid customers using proxy servers?
|
|
#7
|
|||
|
|||
|
Quote:
The number of people using the SAME country proxy server is going to be very very low. Especially considering the number of people who actually use proxies isn't exactly stellar. Free proxies vanish and reappear on a regular basis. ie: One day you're logging in from Canada and the next day it's Botswana. --------- The other great advantage with GeoIP is that you have the possibilty of redirecting your unwanted traffic to a site that can use it..... Possibly getting someone to PAY YOU for the traffic in the process. -------- hostgator has a wonderful cpanel. Why not included the geoip blocking ? It would really be a great feature !!! Quote:
I once saw a .htaccess file that blocked Turkey. It was 100s of lines to do it right. Last edited by Leggyred; 05-03-2007 at 11:20 AM. |
|
#8
|
||||
|
||||
|
I know IP blocking sucks-- however, my point was that HG doesn't have this installed currently, so until they do, I'm not sure how else you can do it.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#9
|
|||
|
|||
|
Quote:
Mod_Geoip from mastermind. (it's free) But the installation is beyond my technical know how.... (anyone want to make a few bucks ? I can pay via paypal) |
|
#10
|
||||
|
||||
|
There's no way you're going to be able to install this yourself on the shared servers, whether you know how to or not. You *may* be able to get HG to do it for you; I'd file a ticket asking them. With a dedicated you could install whatever you want.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#11
|
|||
|
|||
|
EDIT: slapshotw posted while i was replying
|
|
#12
|
|||
|
|||
|
Quote:
Complete with documentation on how to load the .csv into your mysql database and write a php script to compare incoming ips with the db. And yes it's very feasible to install this on a shared account unless you get tons of traffic in which case it may get a bit ugly. With regards to installation. You may find someone to do this for you at getacoder or elance but make sure you donīt give them your account login etc.
__________________
A review directory of cheap web hosting providers
Read my Hostgator review before you sign up Listings of the cheapest web hosting providers |
|
#13
|
|||
|
|||
|
Quote:
My idée is to have somone walk me through the process. That way I can learn and do it for myself later. But I still think it would be a great feature to have in cpanel. |
|
#14
|
||||
|
||||
|
It's too advanced for cPanel... people would end up blocking the wrong IPs and probably not know it...
|
|
#15
|
|||
|
|||
|
Against my better judgement (and obviously others opinions) I'm still using .htaccess for country blocking. Since my site is for a very small group of US business and 90% of attempted attacks come from outside the US, I block out practically every other country.
Currently I have 200 lines of country code letters and 300 lines of IP addresses including full blocks in the .htaccess file. The 500 line file is 17KB and it has not slowed down access to my site. I monitor my logs daily and perhaps need only to add 1-2 IPs per day.... sometimes I actually reduce the number of lines by replacing full IP address by leaving off octets to block all in a matching octet. The .htaccess blocking has been quite effective and I just love seeing those 403 errors..... most give up and never return but some are stubborn! |
|
#16
|
|||
|
|||
|
It would be blocked by nation and not by individual IPs.
|
|
#17
|
||||
|
||||
|
Quote:
If the server gets a little bogged down, you change servers or other factors effect your server, your site will crawl while other's will be passable. Putting those in your .htaccess is a VERY bad idea, but it is not technically wrong. |
|
#18
|
||||
|
||||
|
i come across somewhere online forum, there is people posting php script just to do that. blocking by region/ip range.
i not manage to find the code. sorry. last time i coded in asp before, with a huge database of IP range to check with.
__________________
Charles Gan Hostgatorreview.org
|
|
#19
|
|||
|
|||
|
Now if I wanted to Allow only a specific DNS suffix how would i do that in html?
|
|
#20
|
||||
|
||||
|
That isn't really possible in html, you could do it in php fairly easily.
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 03:16 PM.










