Hotlink prevent unauthorized URL using your images

Sunday, July 31, 2011

Hotlink prevent unauthorized URLs from loading files within specified directories at your site, which uses your bandwidth (also called bandwidth theft and leeching).
Example: Other website using your website image URL to show image on their website.

You can avoid that by creating .htaccess code.


Code:
# Begin hotlink protection #
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domainallow1.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://domainallow2.com/.*$ [NC]
RewriteRule .(gif|jpg|png)$ http://www.image.com/test.gif[R]
# End hotlink protection #


Create htaccess file and upload this .htaccess file to directory where your website files are located.

Here htacces code (hotlink protection) will allow domain 'domainallow1.com' and 'domainallow2.com' to access your website images.

RewriteRule .(gif|jpg|png)$ http://www.image.com/ [R] , it will restrict any other domains rather than  'domainallow1.com' and 'domainallow2.com'  to access your website  image and it will directly point to http://www.image.com/test.gif (you need to create this link) .

Here files are 'gif', 'jpg' and 'png'. You need to make changes in this line RewriteRule .(gif|jpg|png) .

Applicable to iPage, fatcow, Bizland, Ipower, Readyhosting, Startlogic (*only UNIX server).

No comments:

Post a Comment

 

Most Reading

Sidebar One

+1-800-574-0902 +44-20-7993-2673 (ID: 173296)