Stop direct hotlinking?

Discussion in 'General Chat' started by steelfrog, Aug 19, 2008.

  1. #1
    I'm not sure if this is the right place to ask this question, but I figured I'd give it a shot.

    Some websites are copying my tutorials, and even worse, hot-linking the images off my server. I don't want to disable hot-linking completely, but I would like to block the offending domains.

    Is there any way I can do that?

    [EDIT] I found some stuff on modifying the .htaccess, but I'm not too sure how to implement it. Here's my current .htaccess:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Code (markup):
    I need to add in the following:
    
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ /images/nohotlink.jpe [L]
    
    Code (markup):
    Since I already have the Rewrite rule above, do I simply add the rest under it?
     
    steelfrog, Aug 19, 2008 IP