Multiple Redirection With .htaccess

Joined
Jan 20, 2008
Messages
30
Reaction score
24
Does anyone know how to script .htaccess so that it will redirect different referers to different domains?

Here's what I have:

RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_REFERER} ^http://www.referer-domain1.com$ [NC]
RewriteRule .* http://www.yahoo.com/1$ [R=301,L]

RewriteCond %{HTTP_REFERER} ^http://www.referer-domain2.com$ [NC]
RewriteRule .* http://www.google.com/1$ [R=301,L]

Only one RewriteRule works. I can't get both to work for some reason.
 
Try taking the 'L' out of the first rewrite rule so you have:
Code:
RewriteRule .* http://www.yahoo.com/1$ [R=301]
 
Back
Top