Redirect URL except GoogleBot? Please Help!

6 replies
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.
#googlebot #redirect #url
  • Profile picture of the author raggupta2
    Singling out Google should be Blackhat SEO technique. I think your site will be penalized for it if Google detects it.
    {{ DiscussionBoard.errors[6405400].message }}
  • Profile picture of the author mojojuju
    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.
    Signature

    :)

    {{ DiscussionBoard.errors[6407444].message }}
  • Profile picture of the author frankweerasinghe
    anyone yep. I will take the risk...
    Signature
    2CO.ME Premium Domain For Sale!
    ~ Great For Your Own URL Shortener Website ~
    Just Send Me a PM! :)
    {{ DiscussionBoard.errors[6408109].message }}
  • Profile picture of the author taiavatar
    thanks to post
    {{ DiscussionBoard.errors[6408398].message }}
  • Profile picture of the author JezWebb
    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]
    Signature

    Web strategist and adventurer. Director of Search Engine Friendly Hosting. ---Fast, affordable, feature packed hosting from £1.97. --- Search Engine Friendly Web Hosting

    [VIDEO] How to set up a WordPress blog in under 10 minutes.

    {{ DiscussionBoard.errors[6408908].message }}
    • Profile picture of the author frankweerasinghe
      Originally Posted by JezWebb View 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]
      replacing http_referer with user_agent will do the trick? :rolleyes:
      Signature
      2CO.ME Premium Domain For Sale!
      ~ Great For Your Own URL Shortener Website ~
      Just Send Me a PM! :)
      {{ DiscussionBoard.errors[6424694].message }}

Trending Topics