Forum Moderators: phranque
This is my current htacess file:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ [mysite.com...] [R=301,L]
so I added this bit of the code:
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite.com\.com [NC]
RewriteRule \.(gif¦jpe?g)$ - [NC,F]
It works for the hotlinking but it's also preventing images on my site from displaying too - my forums page turned into all text :-) Do I need to add anything to include sub folders & directories on my site?
Does anyone know if there is a work around for this? I mostly use FireFox but most of my visitors use IE :-(
I'm far from an expert but here's one of the methods I use for a client and have no trouble viewing in IE.
SetEnvIfNoCase Referer "^https?://(www\.)?mydomain.com/" ok=1
SetEnvIfNoCase Referer "^https?://(www\.)?images.google.com/" ok=1
SetEnvIfNoCase Referer "^https?://(www\.)?google.com/" ok=1
SetEnvIfNoCase Referer "^$" ok=1
<FilesMatch "\.(gif¦png¦jpe?g)$">
order allow,deny
allow from env=ok
</FilesMatch>
(Keep in mind the pipe character comes through wrong on WebmasterWorld)
I'm not sure if it depends on your host but I have 2 clients on 2 different hosts and though for the other client I use a different code in .htaccess I can still view all images fine in IE.
Hope
I'd suggest you flush your browser cache (Temporary internet files) before testing and between each test, as otherwise your browser will display whatever copy of the image(s) or 403 response it last cached.
Your host is correct, to a point. If you used their 'control panel' hotlinking code, it might block blank referrers, and so might give problems with IE. But the code you posted above (both of you) allows blank referrers, so that should not be the problem. Try flushing your cache first.
If flushing your cache before and between tests doesn't help, then look to your server eeror and access logs to see if you can spot the problem.
Jim
But I noticed yours allows google images so I'll try that one.