Square Wheels Posted October 1, 2015 Posted October 1, 2015 Can I ban IP addresses from viewing the site? I know I can ban them from registering.
Adlago Posted October 1, 2015 Posted October 1, 2015 13 minutes ago, Square Wheels said: Can I ban IP addresses from viewing the site? Add to your htaccess file deny from xxx.xxx.xxx.xxx xxx -> IP address
Square Wheels Posted October 1, 2015 Author Posted October 1, 2015 20 minutes ago, Adlago said: Add to your htaccess file deny from xxx.xxx.xxx.xxx xxx -> IP address OK, thanks. What would the user see?
Mark H Posted October 1, 2015 Posted October 1, 2015 To clarify, you can add that as a block in an .htaccess file, as was noted. The full block of code to add would be: order allow,deny deny from xxx.xxx.xxx.xxx allow from all where xxx.xxx.xxx.xxx is the actual IP Address you want to block. Additional "deny from" lines can be added after the first one, but before the last line, as so: order allow,deny deny from xxx.xxx.xxx.xxx deny from xxx.xxx.xxx.xxx deny from xxx.xxx.xxx.xxx allow from all The exact message they will see depends somewhat on the server, but generally they will get a "You don't have permission to access / on this server" or similar wording.
Adlago Posted October 1, 2015 Posted October 1, 2015 3 minutes ago, Square Wheels said: OK, thanks. What would the user see? Deny your ip and see. Then remove the ban.
IveLeft... Posted October 1, 2015 Posted October 1, 2015 If your on a VPS / Dedi and have root access and csf firewall then in ssh type csf -d [xxx.xxx.xxx.xxx] [reason text] Example to add IP to /etc/csf/csf.deny root@onrahost[~]#csf -d 122.34.5.66 Reason for block You will then need to restart CSF to make the changes take effect csf -r Example to restart csf root@onrahost[~]#csf -r
Square Wheels Posted October 1, 2015 Author Posted October 1, 2015 Thanks all. Not sure if I will be doing this yet. It's actually for one of my best members. He feels he needs an electronic vacation so I banned him from the site (per request), but he still visits the site and emails some of his friends. Before I offered to him the ability to completely ban him, I wanted to see if it could be done.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.