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