Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.229\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?mysite\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://babel.altavista.com/.*(www\.)?mysite\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.243\.113\.1/cgi/
RewriteCond %{HTTP_REFERER}!^http://search.*\.cometsystems\.com/search.*(www\.)?mysite\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://.*searchhippo\.com.*(www\.)?mysite\.com [NC]
RewriteRule \.(gif¦jpg¦jpeg?¦ra¦rm¦ram)$ - [NC,F]
thanks for any help.
To be sure this will work (especially with the RealNetwork-format-files, you should create a hotlinker image in each format and use this new RewriteRule with your existing RewriteConds:
RewriteRule \.(gif¦jpg¦jpeg?¦ram?¦rm)$ /hotlink_image.$1 [L]
RewriteRule \.(gif¦jpg¦jpeg?¦ram?¦rm)$ /hotlink_image.jpg [R,L]
Replace the broken vertical pipes "¦" above with the solid one from your keyboard! Spaces are required before the "!" character in your RewriteRules. Both of these are side-effects of posting on WebmasterWorld.
Also, see this useful Introduction to mod_rewrite [webmasterworld.com] post and the links to references it includes.
HTH,
Jim