WordPress.org

Ready to get started?Download WordPress

Forums

How to hotlink? (6 posts)

  1. Rindert
    Member
    Posted 7 years ago #

    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

  2. whooami
    Member
    Posted 7 years ago #

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

    i think thats it ..................

  3. whooami
    Member
    Posted 7 years ago #

    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]

  4. josalmon
    Member
    Posted 7 years ago #

    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?

  5. whooami
    Member
    Posted 7 years ago #

    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 :P

  6. josalmon
    Member
    Posted 7 years ago #

    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!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags