Quote:
Originally Posted by attroll
Here is the code I have been using. It works without the www in front of the name but when I use the www then the hotlink protection does not work.
Does anyone have any advice?
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://mysite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.net$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.net$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
|
Are you using your domain with our without www?
If you only want to use it with "www":
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mysite\.com
RewriteRule (.*) http://www.mysite.com/$1 [L,R=301]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.mysite.com [NC,R,L]