Block hotlinking apache

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

you want to block other sites to hotlink your images or media files.

Copy this code and paste it in your HTML
  1. RewriteEngine on
  2. RewriteCond %{HTTP_REFERER} !^$
  3. RewriteCond %{HTTP_REFERER} !^http://(www.)?*$ [NC]
  4. RewriteRule \.(gif|jpe?g|png|mov|avi|wmv|mpe?g)$ - [F]
  6. # replace with your site domain

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.