« 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

2 Responses 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 [...]

  2. Webmasters Blog - Salem-News.com / Blocking Hotlinked Images for certain domains Says:
    January 25th, 2009 at 8:33 pm

    [...] Using the method from Blocking certain sites from hotlinking images via mod_rewrite [...]

Comments

You must be logged in to post a comment.