I have been using .htaccess to prevent hotlinking of images from my site and
it works well. However, I am switching to a new host (a dedicated server)
and when I upload the file in the httpdocs directory (named /html) I get a
403 error trying to access any file in the domain - not jut PNG, GIF, or JPG
as specified in the .htaccess file below:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com/.*$ [NC]
RewriteRule .*\.(gif|jpg|png)$
http://www.differentsite.com/hotlinkimg.jpg
[R,L]
I have tried to view the site with and without the www prefix, and with and
without specifying index.html (i.e.mysite.com AND mysite.com/index.html).
Any idea what the problem might be? Again this works fine on my old host
just as I have it here.
Thanks for any suggestions.