Forum Moderators: phranque

Message Too Old, No Replies

disallowing ISP via htaccess

how to do it?

         

Lorel

10:21 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi,

I'm not sure where to post this so feel free to move it if its in the wrong place.

I have a client with a competitor who has been copying content off my client's site every time we update it and posting it around the net under his own name. We managed to get most of it removed by contacting the owners of the sites but it's like putting out a forest fire with a tea cup. We would like to try bannin his ISP. It won't stop him but it will slow him down.

I read on the net I can disallow an ISP by putting code in the .htaccess file but it also didn't load the SSI's that were working earlier after I put this in. Is there something wrong with the code?

<Limit GET>
order allow,deny
allow from all
deny from TheIspAddressWentHere.com
</Limit>

Should I use IP #s instead of the name or does it matter? Any suggestions?

jdMorgan

11:15 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What you have should work. I'm posting this as an example of how to block multiple addresses. The first Deny block a single address, while the second blocks 192.168.1.0 through 192.168.1.255. You can use several different methods to block multiple addresses -- see the Apache mod_access documentation.

If you have the IP addresses, use them. Using a hostname forces your server to do a reverse-DNS request to the DNS system, and this will slow down *all* requests to your server.

Note also that I changed the container from <Limit> to <Files>. Otherwise, you end up restricting access only for the GET method, and not for POST, DELETE, and all the other HTTP methods.


<Files *>
Order Allow,Deny
Allow from all
Deny from 192.168.0.1
Deny from 192.168.1.
</Files>

This code and your original code should have had no effect on SSI. Since SSI includes are done in the server filesystem and not via HTTP, they should not be affected by .htaccess. If the problem persists, post that as a new problem.

Jim

Lorel

12:27 am on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I know how to get the IP numbers but this IP address is only 2 letters with a dot com on the end and the internic won't work with only 2. How do I get the numbers in this instance?

thanks for the tip above.

jdMorgan

12:59 am on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> this IP address is only 2 letters with a dot com

That's not an IP address, it's a hostname.

On Windows, you can use Start->Run->Cmd->Ping to get the IP address by pinging the host. The first line and the next four lines of output from ping will contain the IP address.

Jim

Lorel

5:35 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I use a Mac :o)

wilderness

3:29 am on Jan 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I use a Mac

do a google for george's canufly or use the one of these boxes (I can never recall which)
[dnsstuff.com...]

Lorel

2:27 pm on Jan 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks for that link - a very helpful page!

Lori