How to: Protect your WordPress blog from hotlinking

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


Copy this code and paste it in your HTML
  1. RewriteEngine On
  2. #Replace ? with your blog url
  3. RewriteCond %{HTTP_REFERER} !^http://(. .)? [NC]
  4. RewriteCond %{HTTP_REFERER} !^$
  5. #Replace /images/nohotlink.jpg with your "don't hotlink" image url
  6. RewriteRule .*.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.