hotlink protection (mod_rewrite) cause apache overload

Oh, the strange things mod_rewrite does!

hotlink protection (mod_rewrite) cause apache overload

Postby mmarko » Wed May 25, 2005 2:07 pm

This is the htaccess that kill whole apache (server load goes over 120!)

This htaccess is made by cPanel hotlink protection script.

Please help. I need hotlink protection on my server. Thx.

Code: Select all

#RewriteEngine on
#RewriteCond %{HTTP_REFERER} !^http://betting.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://betting.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://bettingsecrets.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://bettingsecrets.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://dhun.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://dhun.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://dick.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://dick.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://eadvice.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://eadvice.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://erotske-SPAM-price.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://erotske-SPAM-price.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://helppenis.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://helppenis.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://penileenlargement.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://penileenlargement.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://penis.enlargement-advice.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://penis.enlargement-advice.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://penisenlargment.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://penisenlargment.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://pornogalerij.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://pornogalerij.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://sexystars.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://sexystars.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://thehun.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://thehun.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://worldsexxx.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://worldsexxx.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.betting.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.betting.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.bettingsecrets.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.bettingsecrets.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dhun.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dhun.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dick.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dick.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.eadvice.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.eadvice.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.erotske-SPAM-price.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.erotske-SPAM-price.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.helppenis.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.helppenis.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.penileenlargement.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.penileenlargement.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.penis.enlargement-advice.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.penis.enlargement-advice.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.penisenlargment.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.penisenlargment.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.pornogalerij.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.pornogalerij.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.sexystars.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.sexystars.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.thehun.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.thehun.SPAM-galerije.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.worldsexxx.SPAM-galerije.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.worldsexxx.SPAM-galerije.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
mmarko
 

Postby mmarko » Wed May 25, 2005 2:08 pm

Hehe, when I write htaccess with dot I get this "Precondition Failed The precondition on the request for the URL /posting.php evaluated to false.", after submitting the post.
mmarko
 

Postby HM » Tue May 31, 2005 7:47 am

I think you are using the protection incorrectly. What you pasted in pseudo says "If the referer is not any of these URL's then forbid access" ..unless of course you own all those SPAM sites and are using this htaccess to protect them what I think you want is:

Code: Select all
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://yourwebsite.com/base/address/ [NC]
RewriteRule (jpg|jpeg|gif|png|bmp)$ - [F,NC]
HM
 

Postby Caterham » Tue May 31, 2005 11:41 am

So you have some kind of ErrorDocument Directive?
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 4 guests

cron