Redirect URL except GoogleBot? Please Help!

by 6 replies
7
I have a highly rank post on my blog and I just wanna redirect it to my clickbank affiliate link without losing my rankings. So I need to do this with htaccess file. First it must check the USER AGENT... then it must check is there any "google" word on that user agent string. If not, it should redirect user to my aff. link. So far I tried following code without any success.


RewriteCond %{HTTP_USER_AGENT} ^((?!google).)*$
RewriteRule http://www.myblog.com/post-url/ http://www.myafflink.com/ [R=301,L]

Please help.
#programming #googlebot #redirect #url
  • Singling out Google should be Blackhat SEO technique. I think your site will be penalized for it if Google detects it.
  • raggupta2 is correct. You are not the first person to come up with this clever idea. Google will find out if you try to emply such shennanigans.
  • anyone yep. I will take the risk...
  • thanks to post
  • As pointed out - this is not recommended, but if you wanted to redirect to a certain page based on the referrer such as google.com, google.co.uk etc, I've just tested this and it works:

    RewriteCond %{http_referer} google [NC]
    RewriteRule ^$ YOUR FULL URL [R=302,L]
    • [ 1 ] Thanks
    • [1] reply
    • replacing http_referer with user_agent will do the trick? :rolleyes:

Next Topics on Trending Feed

  • 7

    I have a highly rank post on my blog and I just wanna redirect it to my clickbank affiliate link without losing my rankings. So I need to do this with htaccess file. First it must check the USER AGENT... then it must check is there any "google" word on that user agent string. If not, it should redirect user to my aff. link. So far I tried following code without any success.