Forum Moderators: phranque

Message Too Old, No Replies

problem with .htaccess and anti-hotlinking

it doesnt work in IE

         

supernuke

5:45 pm on Feb 20, 2005 (gmt 0)

10+ Year Member



Hello,

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.

supernuke

12:29 pm on Feb 21, 2005 (gmt 0)

10+ Year Member



Hello again, sorry if i my previous post was unappropiated or something, could you tell me if there is something wrong with it? maybe im placing it on the wrong forum or something.

If not, i would like to ask you for help regarding this problem i have tried to solve without any success until now.

Thanks.

jdMorgan

12:20 am on Feb 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



supernuke,

Welcome to WebmasterWorld!

Sorry, this forum is not "Instant Messaging" and it may take awhile to get an answer. :)

What does your server error log say? That is the first place to check if you are getting a 500 error.

Jim

supernuke

11:35 am on Feb 22, 2005 (gmt 0)

10+ Year Member



hello, sorry if i sounded impertinent, actually i just was wondering if my topic was okay to post in this forum, i want you to know that i thank you so much for your assistance.

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.