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.)?your-domain.com/.*$ [NC]
  4. RewriteRule \.(gif|jpe?g|png|mov|avi|wmv|mpe?g)$ - [F]
  5.  
  6. # replace your-domain.com with your site domain

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.