Forum Moderators: phranque
Im fairly new to the htaccess file and Ive been searching for a way of blocking certain isps by either specific IP address or partial IP address (eg 123.123.123.123 or 456.456. ) or by IP name (eg internetprovider.abc.com )
I have looked around this forum and Ive come up with the following from various posts, and would like someone to tell me if it will work.
SetEnvIf Remote_Addr ^123\.123\.123\.123$ banit
SetEnvIf Remote_Addr ^internetprovider.abc.com$ banit
SetEnvIf Remote_Addr ^456\.456\. banit
SetEnvIf Request_URI "^/403\.htm$" allowit
<Files *>
order deny,allow
deny from env=banit
allow from env=allowit
</Files>
thanks
kazrod
Welcome to WebmasterWorld [webmasterworld.com]!
Your code looks fine to me -- I use exactly that sequence on several live sites.
Jim
Ive tried the code in my htaccess file, but it doesnt seem to work.
Ive had to return to using
<Limit GET>
order allow,deny
allow from all
deny from 12.345.67.89
</Limit>
which isnt really what I want as I cant get this to block hosts eg deny from ahost.somewhere.com wont work, neither will it work when I use only part of an IP, the only combo that works is as Ive shown above and this prevents the personalised 403 page from showing.
Is there anything Ive missed on the original that I posted or do I need to activate anything to get it to work?
kazrod
I was working on the basis I had an apache server, it turns out its Zeus/4.1
Id like to thank you for your time (and for pointing me at that util for the header)
.htaccess has been integrated to work on zeus, but it doesnt appear to have the functionality of apache.
Im going to go and do some reading (in between kicking myself )
thanks again for the help,
kazrod