Forum Moderators: mack

Message Too Old, No Replies

Redirecting users redirect users based on ip address

How Do I redirect IP Addresses

         

Price

4:19 pm on Apr 21, 2005 (gmt 0)

10+ Year Member



I have a situation where we have a site for home improvements and I am to be compensated for leads generated by this site and for ranking increases. The boss decided to point his advertising to the main page and now we have a problem.

How can I make search engines like yahoo and google redirect to my entry pages from the search engine results links ... and his from verison go to the main page? I see the stats, but the boss claims that all the leads are only generated by verison...which I highly doubt.

I have tried this with .htaccess file of
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www.google.com/
RewriteRule /* [mysite.com...] [R,L]

but it did not work, so can this be done with IP addresses, I know it can block IP's but how do I do it?

Thanks in advance! :)
Mr Limited Abililites

Span

10:45 pm on Apr 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Price,
you can only do that with IP numbers if you know the IP numbers of your visitors in advance. So I guess that's a no.
You have to use HTTP_REFERER.

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www\.(google¦yahoo)\.com/
RewriteRule .* http://www.site.com/your_entry_page.html [R,L]
RewriteCond %{HTTP_REFERER} ^http://(.*)?veri(s¦z)on\.com/
RewriteRule .* http://www.site.com/the_boss.html [R,L]

A. Make sure you replace the broken pipes ¦ with solid ones.
B. This only works if the browser is sending a referer.

Edit: Just saw this: and his from verison go to the main page?
By that you mean the main page of the site, I think? In that case you don't need the second RewriteCond and RewriteRule.