if ($ENV{'HTTP_USER_AGENT'}=~/^googlebot\/2\.1|slurp|some_other_bot_name$/){ #put any other routines you want to run on the request -> like logs, etc here or just... print "Location: "http:\/\/www\.example\.org\/$ENV{'PATH_INFO'}"; } # And if not in your bot-list, do what you originally planned... else{ your original script's body here }