Forum Moderators: phranque
your help in this matter is highly appreciated
Apache .htaccess runs for each and every request (each individual page, image, script, media file, etc.) to your server. It has no "memory" of any transaction that came before, since HTTP is a 'stateless' protocol and since multiple server instances are running simultaneously. Apache receives a request, serves content in response to that request, and forgets all about it.
Therefore, there is no way to 'count' accesses at the Apache server level. You will need to use a script, and a database and/or session cookies to handle the problem you describe. It is not a particularly easy problem to solve, especially if two or more requests from the same user arrive at your server simultaneously.
Jim