I suck at htaccess. Can someone help me redirect TECHNORATIBOT?

Discussion in 'Apache' started by andheresjohnny, Mar 11, 2007.

  1. #1
    I need to redirect TECHNORATIBOT via htaccess, but I suck so bad at manipulating that file that i'm hopelessly lost.

    Let's say my site is mysite.com. The homepage is mysite.com/home.php

    When TECHNORATIBOT visits mysite.com or mysite.com/home.php, I want to redirect it to mysite.com/index.php.

    Would someone be able to show me the htaccess lines needed to do that?

    Thank you.
     
    andheresjohnny, Mar 11, 2007 IP
  2. andheresjohnny

    andheresjohnny Well-Known Member

    Messages:
    964
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #2
    I forgot to mention that TECHNORATIBOT is the User Agent, so my redirect would have to be based upon that.

    Thank you again.
     
    andheresjohnny, Mar 11, 2007 IP
  3. itdevil

    itdevil Well-Known Member

    Messages:
    632
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #3
    RewriteEngine On
    
    RewriteCond %{HTTP_USER_AGENT} ^TECHNORATIBOT
    RewriteRule ^home.php$ http://www.mysite.com/index.php$1 [L,R=301]
    Code (markup):
    I think this should do the trick :)
     
    itdevil, Mar 11, 2007 IP
    andheresjohnny likes this.
  4. andheresjohnny

    andheresjohnny Well-Known Member

    Messages:
    964
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #4
    I'll give this a shot.

    I really appreciate the help. Thank you very much.
     
    andheresjohnny, Mar 11, 2007 IP
  5. andheresjohnny

    andheresjohnny Well-Known Member

    Messages:
    964
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #5
    I just tried your script. Yes, it worked perfectly.

    I just sent my pittance of green your way.

    Thanks again.
     
    andheresjohnny, Mar 11, 2007 IP