Hi I try to protect my site with an htacess hotlink protection i try to protect the following gif,jpg,png,swf,wmv and mp3 and here is my code RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://mydomain.com [NC] RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com [NC] RewriteRule .*.(gif|jpg|png|swf|wmv|mp3)$ - [NC,F] is this a correct way to do it? thanks
This worked on my site. RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(.+)?mysite.com [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)?anotherone.com [NC] RewriteRule [^/]+.(gif|jpg|png|swf)$ - [F,NC] Code (markup): The '(.+)?' is for all the subdomains.