Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Txp human detection
Working solution, for posterity. It’s a variation of Stef’s suggestion.
RewriteRule "^(articles/.+)" $1?tt=%{TIME} [L,R=303,CO=bot:1:www.mysite.com]
I then had the issue that LiteSpeed (commercial Apache clone) adds a “.” in front of the domain, so I have to expire that cookie in php; otherwise, it has two cookies with the same name and gets all confused:
if ( isset( $_COOKIE["bot"] ) ) {
$counter = 1 + (int) $_COOKIE["bot"] ;
setcookie( "bot", "", time() - 3600, "/", ".www.mysite.com" ) ;
}
else
$counter = 1 ;
setcookie( "bot", (string) $counter, 0, "/" ) ;
Offline