Forum Moderators: phranque
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example\.com [NC]
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_USER_AGENT} googlebot [NC]
RewriteRule \.html$ [newwebsite.com...] [R=301]
RewriteCond %{HTTP_USER_AGENT} msnbot [NC]
RewriteCond %{HTTP_USER_AGENT} Slurp [NC]
RewriteRule \.html$ [anotherwebsite.com...] [R=301,L]
note: with this htaccess I want to refer googlebot to a different url than msnbot and Slurp , so I used another rewriterule for that, but it's not working. it doesn't refer any referers or useragents.
So, the only case when this rule would be triggered would be if the UA was Googlebot, and there was a referrer string that wasn't example.com. Since legitimate Googlebot doesn't have a referrer string, I don't think you're going to get the redirect.
The second part of your code says if the UA is msnbot and the UA is slurp, then do the redirect. This isn't going to happen either. Perhaps you meant:
RewriteCond %{HTTP_USER_AGENT} msnbot [NC OR]
RewriteCond %{HTTP_USER_AGENT} Slurp [NC]