Hi guys, Need some help on this.. Can I code a .htaccess redirect based on referrer only? Currently I have a .htaccess redirect that directs users to another website. But is it possible that I can redirect users when they visit from sites like google.com or others to my main site, and then redirect users to another site if they comes from sites other then google.com (for example). I found this .htaccess code by Googling.. Options +FollowSymLinks RewriteEngine on RewriteRule ^/site.com http://anothersite.com [L,R] Can anyone help me on this code.. Will pay $5 for help.. PM me pls..
Try RewriteEngine On RewriteBase / RewriteCond %{HTTP_REFERER} ^http(s)?://(.*\.)?google\.com/ [NC] RewriteRule ^(.*) http://redirect-because-they-did-come-from-google.com/ [R,L] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?google\.com/ [NC] RewriteRule ^(.*) http://redirect-because-they-didnt-come-from-google.com/ [R,L] Code (markup):