Kevin
Well-known member
You can. Just use the bit of code posted by Anthony Parsons above.Now if there was only away to allow X domain to hotlink, but deny everyone else.
For example, here is the bit of code I've been using on my sites for years...
Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(.*\.)?MySiteA.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*\.)?MySiteB.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*\.)?MySiteC.com(/)?.*$ [NC]
RewriteRule \.(bmp|BMP|gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG)$ http://www.coolscifi.com/redirected.image [R,L]
The entries for MySiteA.com, MySiteB.com, and MySiteC.com are the whitelisted sites that can hotlink; everybody else will be redirected to http://www.coolscifi.com/redirected.image which is an image with my site name. Just keep adding more MySiteX.com entries for each site that you want to allow hotlinking from.