I've enable hotlinking protection from CPanel, but I just want to check and see if I'm doing it right using the .htaccess file in the root of my domain. RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.mysite\.net RewriteRule ^(.*)$ http://www.mysite.net/$1 [QSA,R=301,L] RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://seconddomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://seconddomain.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://thirddomain.net/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://thirddomain.net$ [NC] RewriteCond %{HTTP_REFERER} !^http://images.google.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://images.google.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.images.google.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.images.google.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.msn.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.msn.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://msn.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://msn.com$ [NC] RewriteRule .*\.(jpg|jpeg)$ http://www.mysite.net/hotlink.jpg [R,NC] Code (markup): The seconddomain and thirddomain are friendly sites I want to allow linking from. I also want to allow Google, MSN etc. The hotlink.jpg should be displayed if someone is hotlinking to a file. Will this work, or did I mess up somewhere?
Yes ofcourse this will work. And you could have done easity using hotlink protection section in cpanel. right?