View Single Post
Old 2005-06-23, 02:03 PM   #10
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
If http://www.domain.com/ is protected
If you want to serve http://www.domain.com/image.jpg and allow hotlinking

RewriteEngine on
RewriteRule ^image.jpg$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

If http://www.domain.com/ is protected
If you want to serve anything in http://www.domain.com/image/ and allow hotlinking

put this in your main .htaccess in the root of http://domain.com/
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

and in the image directory put the following in .htaccess
RewriteEngine off
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote