Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite.com/.*$ [NC]
RewriteRule \.(gif¦jpg¦js¦mid¦css)$ - [F]
However I noticed in IE6 WinXP, sometimes CSS files get blocked even when served from mysite.com. It's not all the time, but there seems to be a real consistency issue. Just wondering if my code itself is correct syntax wise, and what could be the cause of the problem?
Thanks,
Some Proxy servers and Firewall programs strip out the Referer, and in that case your rewrite would block the request.
Also if someone views a cached page at a search site and it tries to fetch those external files from your server, they would be blocked as well.
Jim
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER} !^$
The same is true for your second RewriteCond.
Jim
Tip: You can stop the forum from deleting this space by preceding the "!" with a bold-unbold or italic-enditalic tag pair in your post.