Simple Hotlinking in Apache


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



Copy this code and paste it in your HTML
  1. RewriteEngine On
  2. RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
  3. RewriteCond %{HTTP_REFERER} !^http://(.+\.)?google\.com/ [NC]
  4. RewriteCond %{HTTP_REFERER} !^http://(.+\.)?bloglines\.com/ [NC]
  5. RewriteCond %{HTTP_REFERER} !^$
  6. RewriteCond %{REQUEST_FILENAME} !hotlink.png$
  7. RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://mysite.com/img/hotlink.png [L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.