From: "Dave~" <cobaltraq4@xxxxxxx>
To: <cobalt-users@xxxxxxxxxxxxxxx>
Date: Thu, 26 Sep 2002 19:18:50 -0400
Subject: [cobalt-users] .htaccess to pevent hotlinking Raq4
Reply-To: cobalt-users@xxxxxxxxxxxxxxx
Hey everyone,
Been through the archives, been through google and spent the last 4 hours
trying to prevent hotlinking of graphics. The most common answer found for
.htaccess file is:
----------------------------------------
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
Be sure to replace "mydomain.com" with your own. The above code causes a
broken image to be displayed when its hot linked.
----------------------------------------
Which works except that it also disables the images when viewing the protected
site as well. Cleared cache, opened a new browser, typed in the v-site, all
images broken. Permissions are correct, site typed in correctly and the
.htaccess file is in /home/sites/site1/web/images directory. What am I
missing? Syntax change for a virtual site? Problem since it's the first site?
Thanks in advance,
Dave~