« Displaying another image when someone hotlinks | Home | Rewind caret in a non-empty <textarea> »

Blocking certain sites from hotlinking images via mod_rewrite

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?badsite1\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?badsite2\.com/ [NC]
RewriteRule \.(jpe?g|gif|png)$ images/no_hotlink.jpg [L]

Topics: apache, linux, mod_rewrite | Submitter: admin

One Response to “Blocking certain sites from hotlinking images via mod_rewrite”

  1. alex.moskalyuk » Blog Archive » Online .htaccess editor Says:
    February 21st, 2008 at 9:04 pm

    [...] destinations, default pages for Web servers, and a few other things. What it doesn’t have is preventing image hotlinking via mod_rewrite, or setting up .htaccess for a virtual [...]

Comments

You must be logged in to post a comment.

Keep on coding