Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://(www\.)?(example1¦example2)(\.nl¦\.com)/?.*$ [NC,OR]
RewriteCond %{HTTP_REFERER}!^http://example3\.nl/?.*$ [NC,OR]
RewriteCond %{HTTP_REFERER}!^$
RewriteRule .*\.(wav¦js)$ - [F]
Thanks,
Richard
[edited by: jdMorgan at 6:00 pm (utc) on Feb. 1, 2005]
[edit reason] Removed specifics per TOS. [/edit]
Welcome to WebmasterWorld!
> Can somebody tell me what if done wrong?
Yes, remove the [OR] flags from your RewriteConds. The logical structure you want is:
If ((NOT(valid_referrer1 OR valid_referrer2)) AND (NOT(valid_referrer3)) AND (NOT(-blank-)) THEN forbid access.
You can also get rid of the unneccessary ".*" sub-pattern prefixes and suffixes -- they don't do anything.
Also, you should not end-anchor the allowed referrers -- If you do, then image-linking will not be possible from any subpage of those domains:
RewriteEngine On
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?(example1¦example2)\.(nl¦com) [NC]
RewriteCond %{HTTP_REFERER} !^http://example3\.nl [NC]
RewriteRule \.(wav¦js)$ - [F]
Jim