![]() |
Little .htaccess help
I am looking for some help in blocking certain domains from hotlinking (instead them getting an error image)
I know how to do a blanket redirect but not one for specific domains :? specifically I've got two sites showing up in referrals: http://www.ridgeviewelem.org/ http://www.uccpp.org/ i dont know what they are and cant find any information on them (visiting them forwards me elsewhere) and am particuarlly worried about those domains. any help? |
Code:
RewriteEngine on the ! in the prior rules means, if it DOESN'T equal the following. In this case, you remove the !, the rules have an implicit AND, but, you want an OR, so, if it matches firstdomain OR seconddomain, block. |
thanks mate. does this look right?
RewriteCond %{HTTP_REFERER} ^http://(.*@)?([a-z0-9-]+\.)*http://www.ridgeviewelem/.org(:[0-9]+)?(/.*)?$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.*@)?([a-z0-9-]+\.)*http://www.uccpp/.org(:[0-9]+)?(/.*)?$ [NC] RewriteCond %{HTTP_REFERER} ^http://(.*@)?([a-z0-9-]+\.)*http://www.myspace/.com(:[0-9]+)?(/.*)?$ [NC] RewriteCond %{HTTP_REFERER} ^http://(.*@)?([a-z0-9-]+\.)*http://www.xanga/.com(:[0-9]+)?(/.*)?$ [NC] RewriteCond %{HTTP_REFERER} ^http://(.*@)?([a-z0-9-]+\.)*http://www.penny-arcade.com(:[0-9]+)?(/.*)?$ [NC] RewriteRule .*\.(asf|mpg|mpeg|wmv|avi|rm|gif|jpeg|jpg|zip)$ - [F,L] |
you want to put the [NC,OR] on all lines except the last one
|
done. thanks mate. was worried about kids seeing stuff and penny arcade and that elementary school site are both kid related. dont want to make it any easier on those folks but at the same time i got a few hotlinking places i dont mind so much ;)
thanks! |
Also the / in the domain should be a \
|
ok fixed both! :D
|
Not sure if you are aware of this link http://www.htaccesstools.com/hotlink-protection/ ...about htaccess for anti-hotlinking ? I know sometimes when I review submitted sites with htaccess for preventing hotlinking, they forget about the people who use anti virus and personal firewalls which often breaks all images and graphics on a website that uses this method to prevent hotlinking. The problem is blank referrers...so in my submission rules if anyone does this, I gave them that link to solve the broken site images...
|
All times are GMT -4. The time now is 12:04 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc