Blocking IP's not working

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 20 Sep 2013, 16:16

Blocking IP's not working

20 Sep 2013, 16:18

Can anyone help me out.
Our hosting provider has installed ver. 3 but my .htaccess file doesn't seem to accomplish anything
my own local IP is the last in the list, all the other are from spammers/hackers that keep submitting bogus info 100x a day.

I can't see anything wrong with the rules.

HELP!
:>

Brad


RewriteEngine On
RewriteCond %REMOTE_ADDR 117\.41\.184\..*
RewriteCond %REMOTE_ADDR 109\.73\.70\..*
RewriteCond %REMOTE_ADDR 109\.230\.216\..*
RewriteCond %REMOTE_ADDR 178\.239\.58\..*
RewriteCond %REMOTE_ADDR 46\.21\.144\..*
RewriteCond %REMOTE_ADDR 91\.201\.64\..*
RewriteCond %REMOTE_ADDR 210\.77\.88\..*
RewriteCond %REMOTE_ADDR 119\.31\.140\..*
RewriteCond %REMOTE_ADDR 46\.35\.240\..*
RewriteCond %REMOTE_ADDR 109\.254\.87\..*
RewriteCond %REMOTE_ADDR 193\.203\.48\..*
RewriteCond %REMOTE_ADDR 108\.181\.221\..*
RewriteCond %REMOTE_ADDR 108\.181\.221\.192
RewriteRule .* - [F]

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Blocking IP's not working

22 Sep 2013, 17:18

Hello,

The syntax is slightly wrong, and I'm not sure about the logic here. This rule specifies the IPs that will be blocked, and you're saying that yours is the last one...
An example of the rule is provided here - FAQ - http://www.helicontech.com/forum/10648-FAQ.html. I'd guess in your case, if you want this list of IPs to work, and block all the others:

Code: Select all
RewriteEngine On

RewriteCond %{REMOTE_ADDR} !^117\.41\.184\..*
RewriteCond %{REMOTE_ADDR} !^109\.73\.70\..*
RewriteCond %{REMOTE_ADDR} !^109\.230\.216\..*
....
RewriteRule .* - [F]


Regards
Andrew

User avatar
Posts: 5
Joined: 20 Sep 2013, 16:16

Re: Blocking IP's not working

22 Sep 2013, 17:21

Mine is the last one so i can test to see if it works!

thanks, I will try this right away!

User avatar
Posts: 5
Joined: 20 Sep 2013, 16:16

Re: Blocking IP's not working

22 Sep 2013, 17:28

ok, so rewrote the .htaccess and uploaded to the site
My IP is: 108\.181\.221\.192

and I can still get on no problem (all pages)
something with the service provider?

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^117\.41\.184\..*
RewriteCond %{REMOTE_ADDR} !^109\.73\.70\..*
RewriteCond %{REMOTE_ADDR} !^109\.230\.216\..*
RewriteCond %{REMOTE_ADDR} !^178\.239\.58\..*
RewriteCond %{REMOTE_ADDR} !^46\.21\.144\..*
RewriteCond %{REMOTE_ADDR} !^91\.201\.64\..*
RewriteCond %{REMOTE_ADDR} !^210\.77\.88\..*
RewriteCond %{REMOTE_ADDR} !^119\.31\.140\..*
RewriteCond %{REMOTE_ADDR} !^46\.35\.240\..*
RewriteCond %{REMOTE_ADDR} !^109\.254\.87\..*
RewriteCond %{REMOTE_ADDR} !^193\.203\.48\..*
RewriteCond %{REMOTE_ADDR} !^108\.181\.221\.192
RewriteRule .* - [F]

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Blocking IP's not working

22 Sep 2013, 17:37

Sure you can, cause this rule checkis if the requestor is NOT 108.181.221.192 or any other IP from the list, then BLOCK the request. So try to remove your IP from there.
Also, if you have suspicions, try to check if ISAPI_Rewrite is working at all, instructions are at the beginning of FAQ - http://www.helicontech.com/forum/10648-FAQ.html

Regards
Andrew

User avatar
Posts: 5
Joined: 20 Sep 2013, 16:16

Re: Blocking IP's not working

22 Sep 2013, 20:59

I am not sure I understand

how would I block my IP then?

take out the !?
usually the ! is a NOT

like so?:
RewriteCond %{REMOTE_ADDR} ^117\.41\.184\..*


I did the following test:
putting just:
RewriteEngine On
RewriteRule .* - [F]
in the httpd.conf file (in the root of the site)

which brings me to another question- my hosting provider said to modify the .htaccess file NOT the httpd.conf file

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Blocking IP's not working

22 Sep 2013, 23:53

how would I block my IP then?

take out the !?
usually the ! is a NOT

like so?:
RewriteCond %{REMOTE_ADDR} ^117\.41\.184\..*


correct

I did the following test:
putting just:
RewriteEngine On
RewriteRule .* - [F]
in the httpd.conf file (in the root of the site)

which brings me to another question- my hosting provider said to modify the .htaccess file NOT the httpd.conf file


Httpd.conf - is global config file for the whole server.
.htaccess - site's config file.

You can find out more here - http://www.helicontech.com/isapi_rewrit ... oncept.htm

Regards
Andrew

User avatar
Posts: 5
Joined: 20 Sep 2013, 16:16

Re: Blocking IP's not working

23 Sep 2013, 13:53

gotcha - much appreciated

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 17 guests