Hi,
I'm experiencing a weird problem that occurs when I change the default permalinks in WordPress.
When I place this code in my functions.php file in my theme (or even in the root index.php file in WordPress) and navigate between and updating a few pages (for example the /about page), my counter often runs twice.
This problem is reproduced on every server I tried and on any theme or WordPress installation. Another thing that makes my brain even more confused is that it does not occur in Safari, Internet Explorer (6, 7 & 8), but only in Firefox. I'm using Firefox 3.6.8 and has tried it in both Mac OS X and Windows XP.
session_start();
$counter = $_SESSION['wp_action_counter'];
if( !isset($counter) ){
$counter = 0;
}
$counter++;
echo $counter;
$_SESSION['wp_action_counter'] = $counter;
My .htaccess rules looks like this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I'm curious why this happens and is ever thankful to the one who can help me solve the problem.