Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2025-09-28 16:54:30

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 265
Website Mastodon

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

Board footer

Powered by FluxBB