.htaccess Code: RewriteEngine On RewriteRule ^r\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^r/(.*)$ /r.php [L] r.php: Code: <?php $bingurl = "http://url-to-send-the-bing-bot.com"; // in my experience you can even get some urls indexed in bing if you spam hard enough // url where the real people will be sent ( most bots don't follow meta redirect ) $humanurl = "http://url-for-real-people.com"; $a = $_SERVER['HTTP_USER_AGENT']; if(!stristr($_SERVER['HTTP_USER_AGENT'] , "bing")) { if ( $a == '' || // empty user agent stristr($a , "bot") || // user agent contains bot stristr($a , "butterfly") || // user agent contains butterfly stristr($a , "MFE") || // user agent contains mfe stristr($a , "voyager") || // user agent contains voyager stristr($a , "UnwindFetchor") || // user agent contains UnwindFetchor stristr($a , "postrank") || // user agent contains postrank stristr($a , "metauri") // user agent contains metauri ) { if(!stristr($_SERVER['HTTP_USER_AGENT'] , "Twitterbot")) // user agent does not contain twitterbot { //remove the next 3 lines if you don't want to see the detected bots $fh = @fopen("log.txt" , "a"); @fwrite($fh , "BOT: " . $_SERVER['HTTP_USER_AGENT']. "\n"); @fclose ($fh); } header("Location: http://www.google.com"); die(); } } if(stristr($_SERVER['HTTP_USER_AGENT'] , "bing")) { if( $bingurl != "" ) header("Location: " . $bingurl); else header("Location: " . $humanurl); die(); } ?> <html> <head><title>Loading... please wait!</title></head> <body> Loading... please wait! <meta http-equiv="refresh" content="0;url=<?=$humanurl?>" /> </body> </html> short links: Code: your domain is: example.com r.php is at: http://example.com/r.php valid links: http://example.com/r/ANY-RANDOM-STUFF so bitly -> http://example.com/r/dg76GAJSFa -> your link p.s.: this is created by myself it works great if you can manage to set it up (it's very easy to setup though)
You are a prince among men! If you ever fancy sharing that other version that you mentioned in the other thread, that goes to different Google searches, please let us know. In the meantime, I am very happy with this one.
nice, but someone posted a (i think better) script to handle bots a while ago link: http://www.blackhatworld.com/blackhat-seo/black-hat-seo/335475-complete-spiders-crawlers-bots-control-script-redirect-where-you-want.html regards!
Easier, without need of .htaccess is adding not strings but random values to your URLs. PHP: example.com/?var=fwqfw There is no need to handle the variable, if you dont use it in the script, nothing happens. This way you can create as many uniquue urls as you wish and shorten them with shortener.
i actually tried that and seems like twitter is smart enough to catch that fast enough @muxmkt this is made specifically for twitter
It seems this ain't working anymore. Everytime i post a tweet mentioning someone and a link i get my account suspended. Anyone else having this problem and they know any way to fix it?
I found this for yourls.. but it's only for stats.. would anyone be able to edit this script so it would also send them onto google instead of your destination url? ..then I can add in some more user-agents to watch out for. http://code.google.com/p/yourls/wiki/PluginDontLogBots