Portal Home > Knowledgebase > Articles Database > .htaccess to exclude specific geographic areas?


.htaccess to exclude specific geographic areas?




Posted by robertk1, 12-09-2008, 08:48 AM
htaccess to exclude specific geographic areas? Hi I have a client who uses formmail on our dedicated server(another 140 clients also share this PLESK/LINUX server). While the formmail script has not been hacked, some schmuk spends the time to fill it out with spam 5-6 times a day and sends them to the client. I verified the emails go only to the site owner and nobody else. QUESTION: Is there a way to exclude the entire world and only allow visitors from the metro Chicago area? This would need to be done via .htaccess and not IPTABLES, as the other sites on the server draw world wide traffic. I'm scratching my head on this, but if possible it would exclude our schmuk friend while allowing the local traffic this client draws from. Any help is appreciated, and also recommendations to allowing Google and other "necessary" visitors. and thanks! __________________ Custom Web Site Designs eCommerce

Posted by tix3, 12-09-2008, 09:36 AM
You could use Code: order deny,allow deny from all allow from 888.888. And where it says allow from you can add the range that you want. But this solution works only if you know the ip ranges of the area you want. __________________ NOT a webhost!helping here just for the fun of it! G(r)eek inside.

Posted by robertk1, 12-09-2008, 07:25 PM
That is a start ... thank you! __________________ Custom Web Site Designs eCommerce

Posted by Blesta-Paul, 12-09-2008, 07:58 PM
You can also get a geoIP database, like the one MaxMind offers. Then your site can query the database with the visitors IP to find their location and determine if they should have access or not. This would probably be the most robust and reliable way to do it since there could be a lot of IP blocks in the Chicago area that you'll want to include and it would provide an easy way to expand access in the future to more surrounding areas if you choose to. __________________Blesta 2.0Billing that workswww.blesta.com

Posted by robertk1, 12-10-2008, 08:19 AM
Thanks, I will check them out. __________________ Custom Web Site Designs eCommerce

Posted by Mike - Limestone, 12-10-2008, 08:44 AM
Quote: Originally Posted by pphillips You can also get a geoIP database, like the one MaxMind offers. Then your site can query the database with the visitors IP to find their location and determine if they should have access or not. This would probably be the most robust and reliable way to do it since there could be a lot of IP blocks in the Chicago area that you'll want to include and it would provide an easy way to expand access in the future to more surrounding areas if you choose to. Just wanted to add - MaxMind is excellent, and their geographical location services are top-notch. -mike __________________Limestone Networks - Dedicated Server Hosting Premium Network - 24/7/365 Support - Dual Intel Xeon Servers Now Available Dallas Datacenter - Fully Routed Backend Networkhttp://www.limestonenetworks.com 1-877-586-0555



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Top 5 Resellers.. (Views: 675)

Language: