How can I block the bad guys ????

Status
Not open for further replies.

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
As I understand it
due to the way FREE x10hosting's load balancer is setup....

assume IP 000.000.000.000 is bad guy
.htaccess file with this
Code:
<Files *>
order deny,allow
deny from 000.000.000.000
</Files>

Will NOT block the bad guys IP
my server that this .htaccess file is on
only sees the IP of the server that feeds it

Using PHP I can see - but AFTER the bad guy is inside
These hold the bad guys IP
$_SERVER[HTTP_X_FORWARDED_FOR]
$_SERVER[HTTP_X_REAL_IP]
$_SERVER[REMOTE_ADDR]

This holds the IP of the server that feeds our server
which is the IP that is tested in .htaccess
$_SERVER[SERVER_ADDR]

So how can I block the bad guys ????

Thanks
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
I found a post online that looks like it will work.

Code:
RewriteCond %{REMOTE_ADDR} ^111.222.333 [OR]
RewriteCond %{REMOTE_ADDR} ^111.222.444 [OR]
RewriteCond %{REMOTE_ADDR} ^111.222.333.444 [OR]
RewriteCond %{REMOTE_ADDR} ^1.2.3.4
RewriteRule ^.*$ - [F]
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
I found a post online that looks like it will work.


Using my IP here on the computer I use - is the only way I know to test

If my IP was 123.456.789.012
(use real IP in .htaccess file)
This code will NOT block my IP

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} ^123.456.789.012
RewriteRule ^.*$ - [F]
 
Status
Not open for further replies.
Top