Prevent Hotlinking

/ Published in: Apache
Save to your folder(s)

Tired of people using your bandwidth by putting the images hosted on your server on their website? Add the following code at the bottom of your .htaccess file to prevent hotlinking.

Copy this code and paste it in your HTML
  1. Options +FollowSymlinks
  2. #Protect against hotlinking
  3. RewriteEngine On
  4. RewriteCond %{HTTP_REFERER} !^$
  5. RewriteCond %{HTTP_REFERER} !^http://(www.)? [nc]
  6. RewriteRule .*.(gif|jpg|png)$[nc]


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.