eugeneg Posted November 2, 2014 Share Posted November 2, 2014 The amount of bandwidth my website consumes grows each month and I am now bumping up against the maximum my hosting company allows on my package. I believe some 80% of the hits are from overseas bots that I have no interest in serving.What's the best way to limit access - perhaps to UK residents only. I currently have a huge .htaccess but it is permanently out of date and updating it each time a genuine user complains is a pain. Not only that, I don't want to block 'genuine' users with my 403.shtml Thanks. Link to comment Share on other sites More sharing options...
niche Posted November 2, 2014 Share Posted November 2, 2014 Do a login, or a script that only lets pre identified ips on your full site. Link to comment Share on other sites More sharing options...
eugeneg Posted November 2, 2014 Author Share Posted November 2, 2014 A login is not appropriate in this instance. Letting predefined IPs on is exactly what I have been trying in my .htaccess but I don't know how to get a complete and authoritative list of IPs allocated to UK based ISPs. Link to comment Share on other sites More sharing options...
niche Posted November 2, 2014 Share Posted November 2, 2014 start saving them and looking them up. http://stackoverflow.com/questions/3003145/how-to-get-the-client-ip-address-in-php Link to comment Share on other sites More sharing options...
justsomeguy Posted November 3, 2014 Share Posted November 3, 2014 Here's a list of the major IP address blocks assigned to the UK:http://www.nirsoft.net/countryip/gb.htmlYou could also use an IP geolocation service to look up where each individual user is and check their location that way. 1 Link to comment Share on other sites More sharing options...
eugeneg Posted November 3, 2014 Author Share Posted November 3, 2014 That's more like what I was looking for, thanks. The IP geolocation route seems exactly what I need. I have found several free sites offering this, but I lack the technical nouse to implement it right now. Are you aware of any training sites or such places where I can teach myself how to do this ? Presumably it would be incorporated into the PHP header of each page of the site. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 3, 2014 Share Posted November 3, 2014 You're just talking about general PHP training, there wouldn't be anything specific to using a geolocation service that you wouldn't learn elsewhere. Different sites might offer different kinds of APIs, maybe XML based or JSON or something using SOAP. You'll need to understand how to use PHP to use the data for any of them though. Link to comment Share on other sites More sharing options...
Beyonder Posted November 20, 2014 Share Posted November 20, 2014 Also do something for the proxy users. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now