Search code examples
php.htaccessmod-rewriterobots.txtalexa-internet

How can I block Alexa Toolbar users?


Any ideas how I can block Alexa Toolbar users? I don't want to appear in the rankings while we are in beta ...

I see you can block their search engine with

User-agent: ia_archiver
Disallow: /

but I can't find any documentation on how to pull your self from actually being ranked.. I read earlier someone tried to email them and they rufused.. So I guess I'm forced to block them?

Any better ideas, or way ideas on how to block them access?


Solution

  • For those finding this post later I worked out my own solution. Seems when the alex toolbar is installed it shows up in the user agent.

    <?php 
    echo $_SERVER['HTTP_USER_AGENT'];
    ?>
    

    You can redirect those users with php

    preg_match('/(Alexa)/i',$_SERVER['HTTP_USER_AGENT'])?header('Location: http://alexausersgohere.com'):null;
    

    You could also just redirect them by dumping this in your .htaccess file.

    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} ^Alexa
    RewriteRule ^(.*)$ alexausersgohere.com#$1 [R=301,L]
    

    Make sure you double check that htaccess code I just wrote it as a demonstration, its un-tested I used php.