Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Prevent Image Hotlinking  (Read 2476 times)

0 Members and 1 Guest are viewing this topic.

Leo.Prince

  • Guest
Prevent Image Hotlinking
« on: November 01, 2013, 09:26:18 am »
Add The Following code to a .htaccess file in your home folder.

Code: [Select]
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/)?.*$     [NC]

RewriteRule .*.(gif|jpg|jpeg|bmp)$ – [F,NC]

In the example above be sure to replace domain.com with your actual domain name.   This will stop other sites from hotlinking images that end in .gif, .jpg, .jpeg, and .bmp.