Log in

View Full Version : How do I block ONE domain in my htaccess?


7hom4s
2005-01-22, 09:25 AM
I've tried just about anything. Can someone here please, please help me inserting a piece of code that will get rid of traffic from besthardcore.net?
This is my htaccess file as it is now, preventing only hotlinking, but not traffic from this useless tgp or whatever it is:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sensual-ladies.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?catyxxx.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.sensual-ladies.com [R,NC]

Can someone please help me, rewriting this, so I can just upload it?
Each time I try to change it, I end up not having access to my sites, no matter from where I try to gain access. I just need this ONE single domain to get lost as soon as possible.

7hom4s

eskimoen
2005-01-22, 10:27 AM
You can use http://www.htaccesstools.com/block-hitbots/

7hom4s
2005-01-22, 10:38 AM
You can use http://www.htaccesstools.com/block-hitbots/
Thanks, I found that one too, but no matter how I try to import it to my excisting htaccess file, it screws everything up.

7hom4s

cd34
2005-01-22, 10:44 AM
RewriteEngine on
RewriteCond %{HTTP_REFERER} http://(www\.)?besthardcore.net(/)?.*$ [NC]
RewriteRule .* - [F]

This will 403 ANY traffic from besthardcore.net.

You can define:

ErrorDocument 403 http://www.domain.com

and send them on their merry way

7hom4s
2005-01-22, 10:49 AM
RewriteEngine on
RewriteCond %{HTTP_REFERER} http://(www\.)?besthardcore.net(/)?.*$ [NC]
RewriteRule .* - [F]

This will 403 ANY traffic from besthardcore.net.

You can define:

ErrorDocument 403 http://www.domain.com

and send them on their merry way

It's nice of you to try to help me, but here's the problem: I can find a lot of sources showing me how to make the text, like the one above. But no where is it shown HOW to import it into my excisting htaccess. So it's useless for me, unless I know what the rest of my code should look like. I need my code rewritten, so that I can use both things.

7hom4s

cd34
2005-01-22, 10:53 AM
just paste that snippet into your .htaccess above your anti-hotlink rules

7hom4s
2005-01-22, 10:59 AM
just paste that snippet into your .htaccess above your anti-hotlink rules

Snippet? Would you copy it into my htaccess that I've posted in this toppic?
I'm sorry for being so bad at this, but each time I try anything, nothing works at all.

7hom4s

cd34
2005-01-22, 11:00 AM
RewriteEngine on
RewriteCond %{HTTP_REFERER} http://(www\.)?besthardcore.net(/)?.*$ [NC]
RewriteRule .* - [F]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sensual-ladies.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?catyxxx.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.sensual-ladies.com [R,NC]

7hom4s
2005-01-22, 11:16 AM
RewriteEngine on
RewriteCond %{HTTP_REFERER} http://(www\.)?besthardcore.net(/)?.*$ [NC]
RewriteRule .* - [F]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sensual-ladies.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?catyxxx.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.sensual-ladies.com [R,NC]


Now it happens again. If I import this & upload it to my host, I end up getting redirected even if I try my main page.
Something just goes wrong every single time, I don't get it.

7hom4s

cd34
2005-01-22, 11:23 AM
you wouldn't get redirected because of those rules. You must have something else in the .htaccess

7hom4s
2005-01-22, 11:29 AM
you wouldn't get redirected because of those rules. You must have something else in the .htaccess

Well, that would make a lot of sense, only question is where? I've copied it exactly, so there's nothing left out. Could it be a matter of uploading it to a specific directory? I upload my htaccess to my main folder, in which all my galleries are.

7hom4s

Useless
2005-01-22, 12:22 PM
RewriteEngine on
RewriteCond %{HTTP_REFERER} http://(www\.)?besthardcore.net(/)?.*$ [NC]
RewriteRule .* - [F]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sensual-ladies.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?catyxxx.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.sensual-ladies.com [R,NC]


I'm far from knowing what I'm doing, but could it be the lack of a ^ in front of http://(www\.)?besthardcore.net(/)?.*$ [NC] causing the problem? I have that in front of the domains I block.

Copy and paste this new line:
RewriteCond %{HTTP_REFERER} ^http://(www\.)?besthardcore.net(/)?.*$ [NC]
over the current besthardcore.net line in your .htaccess and give it a swing.

frankthetank
2005-01-23, 06:52 AM
Now it happens again. If I import this & upload it to my host, I end up getting redirected even if I try my main page.
Something just goes wrong every single time, I don't get it.

7hom4s

When you upload the .htaccess code, make sure to use ASCII mode and not binary. Binary will probably mess up your file.

7hom4s
2005-01-23, 07:00 AM
When you upload the .htaccess code, make sure to use ASCII mode and not binary. Binary will probably mess up your file.

I did upload it in ascii mode, actually it seems to be because I had htaccess files spread all over the place, instead of just one covering from my main directory. This combined with the support at my hosting, got these leeches of my back, at least for now |bananna|

7hom4s