Forum Moderators: phranque
im using an apache server and im confirmed it supports rewrite mode and all the necesary to allow anti-hotlinking feature, however im experiencing the following problem.
First, i would like to introduce my objective with anti-hotling my files. Im trying to protect my files from being linked from other sites others than those which i allow, and also preventing users from accesing them via direct request (by entering the url in the navigator bar) but im also trying to set certain allowed sites, out of my webserver space. All this works perfectly with mozilla and other browsers except IE, browser i sincerly dont use because i consider it extremely bad and this is an example of that, however most internet users have it, then i need to fix this issue in IE.
Im using this code:
RewriteEngine on
RewriteCond %{REQUEST_URI}!^/downloads/images/.+
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain.com [NC]
RewriteCond %{REQUEST_URI}!^/.+
RewriteCond %{HTTP_REFERER}!^http://(www\.)?allowed-site.net [NC]
RewriteRule \.(jpe?g¦gif¦htm¦html)$ - [NC,F]
Would you please tell me what is wrong with this code above? when i try to access the files from the allowed refers or my domain itself, i got a 500 error, i dont know why, i have changed the code, and there is always something that doesnt work; please dont suggest me to ask support to my server, i already did that, and they told me they dont have any idea and that i should ask apache about this, so i thought i should come here and ask you for some assistance, please.
Thanks in advance.
If not, i would like to ask you for help regarding this problem i have tried to solve without any success until now.
Thanks.
At the very beginning i got a 500 error, but i dont have it anymore, the files can be accesed, but there is no hotlink protection. Above i have posted the code im using for it, is there something wrong with it? i copied it from a topic in this forum.
Could anybody please tell me what is wrong with the code above or help me find the right code according the conditions i described in my last post? something like this
-allow linking from my domain and from another site i set as allowed
-deny direct requests from browser
-that works also in IE
is this posible?
thanks again.