Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hotlink Protection does NOT work in IE (works in Firefox)

    hello CF,

    i want to disallow hotlinking to a specific websites only, so basically i will hotlinking to all websites except for the URL www.site1.tld, www.site2.tld, www.site3.tld etc.

    i had this code below for about a week, i thought it worked perfect but to my surprise i realize that it only works in Firefox and not IE, i just noticed this today, i was at work and was browsing (using IE) a few sites that's hotlinking to my swf files, i noticed that all of my swf files loads properly on their websites which werent supposed to because i used the code below to disallow hotlinking to this websites

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} site1.tld [OR,NC]
    RewriteCond %{HTTP_REFERER} site2.tld [OR,NC]
    RewriteCond %{HTTP_REFERER} site3.tld [NC]
    RewriteRule \.(jpg|jpeg|swf)$ - [NC,F]
    now when i got back home i visited those sites that are hotlinking to my swf files using firefox and my swf files was not loading, i then tested it using IE and swf files was loading properly...

    so basically my hotlink protection only works in firefox and not IE, i cleared my IE cache so its not getting those files from the temp folder

    is there anyone outthere know what's going on here or could correct my code above?

    any help will be appreciated, thanks

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?site3\.tld [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?site2\.tld [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?site3\.tld [NC]
    RewriteRule .*\.(jpg|jpeg|swf)$ - [NC,F,L]
    The above was modified from a hotlinking script someone else gave me.

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    _Aerospace_Eng_ thanks for the reply, i tested out your code but i believe your code prevent hotlinking to all websites except for the URL your specify in the "RewriteCond" i want to do the opposite

    i may post an example later for better understanding

    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •