Thread: .htaccess Help
View Single Post
Old 11-27-2014, 06:08 PM  
Jel
Confirmed User
 
Jel's Avatar
 
Industry Role:
Join Date: Feb 2007
Posts: 6,904
master domain root:

Code:
RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com:80.*$ [NC]

RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.originaldomain/hotlinkimagefolder/hotlinkimage.jpg
then this in your http://www.originaldomain/hotlinkimagefolder/ to allow the hotlinked image:

Code:
RewriteEngine on 
RewriteRule ^.*$ -
not sure on the 'gospel' code, but had that on a domain for years, to do exactly what you want, with zero problems. May need tidying up to be how a pro coder would do it, and tweaking for extensions other than jpg/gif, but that will get you up and running for now
Jel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote