what the FUCK im doing wrong. htaccess anti hotlink help please.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nico-t
    emperor of my world
    • Aug 2004
    • 29901

    #1

    what the FUCK im doing wrong. htaccess anti hotlink help please.

    im posting this here cuz noone barely goes to the webmaster q n a forum.
    i got this code:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?hotlinksite\.com/ [NC]
    RewriteRule \.(gif|jpe?g|png)$ http://www.mydomain.com/des/test/hotlinkimg-d.gif [NC,L]

    hotlinksite.com is the site that has permission to hotlink from my domain.
    The anti hotlink works perfect. But that fucking substitute image just won't appear on sites that dont have hotlink privileges!
    I already checked fusionx's tut but i tried everything, i looked on the fucking web all over and they give the same fucking code but it doesnt fucking work! Could someone please help me with this shit...
  • Manowar
    jellyfish  
    • Dec 2003
    • 71528

    #2
    http://altlab.com/htaccess_tutorial.html

    Comment

    • NinjaSteve
      Too lazy to set a custom title
      • Dec 2003
      • 11089

      #3
      are you using a linux or windows server?
      ...

      Comment

      • nico-t
        emperor of my world
        • Aug 2004
        • 29901

        #4
        Originally posted by NinjaSteve
        are you using a linux or windows server?
        lol i dont know! i got a host, i pay every month a bill i aint got my own server... and i dont know shit about servers either.
        Anyway, with the help of manowars link (thanks) i looked a bit closer and it seems that the image url for the hotlink image CAN NOT be your whole url where the image is hosted for some weird reason.... only the dirs. Thats prett strange if u ask me. But it works:

        RewriteEngine On
        RewriteCond %{HTTP_REFERER} !^$
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com/ [NC]
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?hotlinksite\.com/ [NC]
        RewriteRule \.(jpe?g|gif|bmp|png)$ des/test/hotlinkimg-d.gif [L]


        ^^^ check the last line, i did it without http://www.mydomain.com/ and now it does work. Crazy shit, i hate these kinda code jobs there always something wrong that noone can explain and totally unlogical. Doom the fucking nerds that invented this haha..

        Comment

        • nico-t
          emperor of my world
          • Aug 2004
          • 29901

          #5
          ok another thing:
          which sites can hotlink my images! I got google in the code already like this:
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?google\.com/ [NC]
          but if im coorect does yahoo have the option for surfers to create their crappy personal homesites? if so, when i put this code in:
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?yahoo\.com/ [NC]
          Those freeloaders on a yahoo directory website can still fucking hotlink!

          Plus i want a list of people who are experienced with what sites not to block, like a list with (image) searchengines or something, so my images will still pop up there!

          Comment

          Working...