Support » Fixing WordPress » How to hotlink?

  • Hello,

    At 365.be I want to hotlink every image. I can’t find to see what I’m doing wrong so maybe wordpress can help me out. I’m working with wordpress 2.04

    This is what I do (.htaccess file)

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?365\.be/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule ..*\.(jpe?g|gif|bmp|png)$ – [F]

    If have also tried to add Options +FollowSymlinks or leave RewriteEngine On or to leave both out. Nothing works and according to phpinfo mod_rewrite is installed.

    Thank you for helping me

    Rindert Dalstra
    http://www.365.be

Viewing 5 replies - 1 through 5 (of 5 total)
  • whooami

    (@whooami)

    Member

    Perhaps you mean you want to BLOCK people from hotlinking to files on your domain?

    i think thats it ………………

    whooami

    (@whooami)

    Member

    if you want to block hotlinkers.. your code is incorrect:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$ [NC,OR]
    RewriteCond %{HTTP_REFERER} !domain.com [NC]
    RewriteRule .*.(jpe?g|gif|bmp|png)$ - [F]

    This is the code I use which seems to work just fine. Can’t remember where I found it though.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://(.+.)?myspace.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+.)?freewebs.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+.)?blogspot.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+.)?livejournal.com/ [NC]
    RewriteRule .*.(jpe?g|gif|bmp|png)$ /imagename.jpe [L]

    sorry for sounding dim, but out of curiosity, what’s the difference between mine and whooami’s?

    whooami

    (@whooami)

    Member

    youre rewriting the image with another image, I used the code for a 403.
    And your allowing some other sites to hotlink, (a good idea since feedburner, etc.. hotlink the images off the feeds).

    My own code is very *similar* to yours.. i just redirect them somewhere else, and its too obscene for sharing here 😛

    Lol

    Cheers for clarifying that! This is the one problem with copy n paste – I can put some stuff together by looking at what other people have done but I don’t understand it!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to hotlink?’ is closed to new replies.