.htaccess Redirect with condition

So what I’m trying to do is only allow people that come from a certain site to view a website. If they don’t come from the site in the list, then they will be redirected somewhere else. So here is a way to do it that someone posted, but it’s not working for me:


RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http://www\.alainfontaine\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.kirupa\.com/ [NC]
RewriteRule ^.*$ http://www.yahoo.com [r=301,L]

It’s just an example. But it’s not working right because it’s redirecting everything to Yahoo. Even when I click my link from the kirupa forum.

You guys know of a way I can do this? If you know how to write the .htaccess code stuff this should be easy to do then.

Thanks in advance. :slight_smile: