Help with Preventing Hotlinking

Discussion in 'WordPress' started by PPCInformer, Jun 28, 2008.

Thread Status:
Not open for further replies.
  1. #1
    Hi fellas

    I want to prevent other sites from hotlinking from my site

    .htaccess on my server is
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    AddType Applicaions/CAB .cab
    Code (markup):
    what i want to do is each time a hot-link is done to a (cab,zip,rar,exe ) I waant the user to land on
    http://www.1800pocketpc.com/sorry-hotlinking-has-been-disabled
    Code (markup):
    and when an image (jpg/jpeg/bmp/png/gif) is hotlinked I want this image to be shown on the other site, having this image hosted on my site might not work so itys hosted on image shack
    http://img168.imageshack.us/img168/7426/hotlinkingdisabled4117djv3.jpg
    Code (markup):
    I am not sure what I have to add in to .htaccess , This is what I have come up with ( through google ) , I am not sure if this is correct though
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    AddType Applicaions/CAB .cab
    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?1800pocketpc.com/.*$ [NC]
    #RewriteRule \.(gif|jpg|png|gif|bmp)$ - [F]
    #RewriteRule \.(gif|jpg|png|gif|bmp)$ http://img168.imageshack.us/img168/7426/hotlinkingdisabled4117djv3.jpg [R,L]
    #RewriteRule \.(cab|zip|rar|exe)$ - [F]
    #RewriteRule \.(cab|zip|rar|exe)$ http://www.1800pocketpc.com/sorry-hotlinking-has-been-disabled [R,L]
    
    Code (markup):
    can some one tell me if this is right. thanks
     
    PPCInformer, Jun 28, 2008 IP
  2. golddragon

    golddragon Active Member

    Messages:
    583
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #2
    golddragon, Jun 28, 2008 IP
Thread Status:
Not open for further replies.