PHP Link Directory
 

Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > PHPLD Community

PHPLD Community Have suggestion about the site? Or want to network?

Reply
 
topic widgets
Old 07-14-2012   #1
bosanci28
Licensed
 
bosanci28's Avatar
 
Join Date: Dec 2009
Location: jungle of us-ro
Posts: 114
Default blocking specific countries in .htaccess?

i have some specific countries that comes and are submitting links to my directory,can someone tell if possible to block those countries by adding something in main .htaccess file?

if yes,please provide a example here how to do it,

i have few countries ,like .ch .pl and others,

thank you for any advice...
bosanci28 is offline   Reply With Quote
Old 07-14-2012   #2
David
Administrator
phpLD Administrator
Licensed
 
David's Avatar
 
Join Date: Jan 2005
Posts: 14,317
Default

Look on the left side of http://software77.net/geo-ip/ and you can list of all the IPs from a country. Then you have to get all those addresses into htaccess like this
order allow,deny
deny from 127.0.0.1
deny from 127.0.0.2
deny from 127.0.0.3
allow from all

If you have root access, a server admin can block a country in 30 seconds, but with htaccess, so far as I know, it is a little more work.
__________________
Follow phpLD on Twitter - and facebook
Nearly 400 templates you may have never seen
Recommended Host
Make awesome sites and the rest will follow. Free your mind. Don't be so shallow.
David is offline   Reply With Quote
Old 07-14-2012   #3
James
:)
phpLD Support
phpLD Administrator
Licensed
Moderator
 
James's Avatar
 
Join Date: Aug 2006
Location: St. Peter's, NS , Canada
Posts: 32,803
Default

You could do it in php using the free dtabase from maxmind and a little code in the init.php OR

you can go here and get the ip ranges

http://www.find-ip-address.org/ip-country/


though you can end up with a HUGE htaccess.

IF your own server install CSF and it will allow you to block countries easily
__________________
Ask me how you can get phpLD for free
Attention: For Support Please Read this thread.
IF the domain is not listed in your PhpLD users area and it is a paid product.
You will have to list it before ANY questions are answered.

PhpLD Recommended Hosting: Here
They work with you not against you
Live Directory
James is offline   Reply With Quote
Old 07-14-2012   #4
bosanci28
Licensed
 
bosanci28's Avatar
 
Join Date: Dec 2009
Location: jungle of us-ro
Posts: 114
Default

hi,and thanks for your advice!

i found this website here:

http://www.ip2location.com/blockvisitorsbycountry.aspx


and i choose the few countries that i see submition is coming from
and i highlight them and create a deny list and past it into my .htaccess,
now hope that works...

long list from only 5 countries!
Code:
Content visible to registered users only.
countries: ch,pl,co.za,si,uk.

list is longer than what i posted here..

thanks
bosanci28 is offline   Reply With Quote
Old 07-19-2012   #5
DirectoryDude
Licensed
 
DirectoryDude's Avatar
 
Join Date: Sep 2010
Location: Brooklyn, NY
Posts: 1,441
Default

I found a great site for this I have been getting them from ip ranges in India here is the site I found
http://www.ipaddresslocation.org/ip_...get_ranges.php
DirectoryDude is offline   Reply With Quote
Old 07-19-2012   #6
bosanci28
Licensed
 
bosanci28's Avatar
 
Join Date: Dec 2009
Location: jungle of us-ro
Posts: 114
Default

what ever i did ,i am still getting the submitting from those countries...

offf....
bosanci28 is offline   Reply With Quote
Old 07-19-2012   #7
DirectoryDude
Licensed
 
DirectoryDude's Avatar
 
Join Date: Sep 2010
Location: Brooklyn, NY
Posts: 1,441
Default

I blocked them in my server Firewall Waiting to see if it worked. CSF is a nice Firewall for VPS and Dedicated servers
DirectoryDude is offline   Reply With Quote
Old 07-19-2012   #8
bosanci28
Licensed
 
bosanci28's Avatar
 
Join Date: Dec 2009
Location: jungle of us-ro
Posts: 114
Default

i host with hostmonster dot com my site ,can they do that...or maybe not..
bosanci28 is offline   Reply With Quote
Old 07-19-2012   #9
James
:)
phpLD Support
phpLD Administrator
Licensed
Moderator
 
James's Avatar
 
Join Date: Aug 2006
Location: St. Peter's, NS , Canada
Posts: 32,803
Default

if using csf save overhead and use the country blocking option


@boscani28 they wont do it on a shared server since others are on the server and they probably want the traffic
__________________
Ask me how you can get phpLD for free
Attention: For Support Please Read this thread.
IF the domain is not listed in your PhpLD users area and it is a paid product.
You will have to list it before ANY questions are answered.

PhpLD Recommended Hosting: Here
They work with you not against you
Live Directory
James is offline   Reply With Quote
Old 07-19-2012   #10
DirectoryDude
Licensed
 
DirectoryDude's Avatar
 
Join Date: Sep 2010
Location: Brooklyn, NY
Posts: 1,441
Default

Code:
Content visible to registered users only.
In config of CSF look for CC_DENY = and in the box put in the country code
DirectoryDude is offline   Reply With Quote
Old 07-19-2012   #11
VSDan
Licensed
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,363
Default

CSF will probably not work for most here as CSF is usually reserved for VPS or dedicated servers. In which case, your web host (with much luck) may agree to installing mod_geoip. Works very well, but more overhead compared to CSF. Then, you can easily and readily ban countries per directory via mod_geoip directives in your top .htacess file. For example (to block from China):

Code:
Content visible to registered users only.
VSDan is offline   Reply With Quote
Old 10-02-2012   #12
shadav
Mentor
Licensed
Moderator
 
shadav's Avatar
 
Join Date: Dec 2006
Location: Some Place In Indiana, USA
Posts: 5,912
Default

because there is not good answer user end....your host/server admin would be better suited to block incoming ips/domains/countries.
__________________
The Help Line :: Webmasters Resource Directory
Foamiki :: Foamy The Squirrel Wiki & Videos
Shadav Network Products :: phpLD Mods, Widgets & Templates
4REarth :: Reduce, Reuse, Renew, Recycle. Upcycling for the average person.
shadav is offline   Reply With Quote
Reply

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
topic widgets


Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess - If using a MAC! aZooZa PHPLD Community 4 02-05-2008 12:21 PM
change .htaccess in PHPLD3.2 (Prevent .htaccess errors) Freewebspace Mods and contribution Discussion 4 06-13-2007 05:49 AM


All times are GMT +1. The time now is 06:44 AM.


powered by vB