How do I prevent others from hot linking my pictures or movies?
Posted by Administrator on 24 December 2009 10:48 PM
How do I prevent others from hot linking my pictures or movies?
You need to create an .htaccess file in the 'public_html' directory that contains the
following code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://YOUR_IP_ADDRESS/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://YOUR_FIRST_DOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOUR_FIRST_DOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://YOUR_SECOND_DOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOUR_SECOND_DOMAIN.com/.*$ [NC]
RewriteRule .*.(gif|GIF|jpg|JPG)$ - [F]

For each domain that you have content, just add two lines to the .htaccess
file like below:
RewriteCond %{HTTP_REFERER} !^http://YOUR_SECOND_DOMAIN.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOUR_SECOND_DOMAIN.com/.*$ [NC]

Just make sure the first two lines and the last line is always the same.
You may also add more to the last line for any other file type that you
would like to prevent from being hot-linked (mov, asx, mpg, etc), just
follow the syntax above (mov|MOV|asx|ASX).

OR: Easier method:
1. Login to Cpanel
2. Click 'Hotlink Protection'
(583 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).