Hello,

I have a few free dating sites and want block dating spammers who register on my websites.

I have been using htaccess to block a lots of IP addresses from my free dating sites. However, they still come back to register their profiles at my sites.

Is there a better way to block a specific country from my dating site?

Thanks.

Try doing a Google search for a list of IP blocks from a specific country. For example, here is a list but it is rather old (May 2009): http://www.countryipblocks.net/country-blocks/htaccess-deny-format/

The other way you can do it is with geolocation software. You can use IP geolocation to determine the country the user is located in, and if they are in a country you don't want, give them a friendly message saying that registration is currently closed to them, but they can still browse the site.

An example of geolocation software is www.quova.com

There's also GeoLite which offers a free version, if I remember correctly: http://www.maxmind.com/app/geolitecountry

Create and upload an .htaccess file and paste the code:
order deny,allow
deny from 000.000.00.0
(IP you want to deny, you can use the first numbers of the IP for a complete country)

nomajulu,

That's what he's doing already, but he's doing it for a lot of different IPs manually. He's wondering if there is a better way.

I believe most of the spammer will use the proxy to spam the stuff, therefore i may suggest you to use the proxy detector to block them out from reaching your page. Check this out: http://www.ip2proxy.com

There is a way to determine the origin country of an IP but when I last checked on it it was very complicated. By now there should be APIs out to tell you the origin country. The reason I'm saying to go with country is because usually that's what your problem is. It's usually girls wanting to get hooked up on mail order bride stuff. Get married and get into the US.

nomajulu,

That's what he's doing already, but he's doing it for a lot of different IPs manually. He's wondering if there is a better way.

Blocking only the specific IP blocks from that country is simple and smart. And there are not that many IP blocks per one country.

Anyway, if you are using wordpress, you might as well search for some IP blocking plugins, as I know there are some that can help you.

You can do that simply by blocking your site servcies in that country IP . This is not a big task which is worring about.

I found this solution, refer to this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.