Help - Search - Members - Calendar
Full Version: Blocking Hotlinking
Movable Type Community Forum > Additional Resources > Tips and Tricks
joeszilagyi
Hi,

I've been playing around with blocking hotlinking off of my site, and have had problems with it. Does anybody else do this for images on your domain names here? This is what I've been trying to use:

CODE
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://szilagy.us/.*$[NC]
RewriteCond %{HTTP_REFERER} !^http://www.szilagyi.us/.*$[NC]
RewriteRule .*\.(gif|GIF|jpg|JPG)$ - [F]


...as an addition to my .htaccess file. "Options FollowSymlinks" is already enabled on the .htaccess. When I add this code, though, and try to go to http://www.szilagyi.us/index.phtml it just blocks all of my own images (but it does block hotlinking off my test URL on my friend's site!). I know that I'm close, but how do I keep it from blocking my own domain as well? I can't quite nail it and keep thinking that I'm just barely missing some syntax somewhere...

Anyone...?
Georgina
I'm not an expert on .htaccess by any means, but I believe you need a second line after RewriteEngine on.

QUOTE
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$


...and then the rest of your file.  See if that makes a difference?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.