I'm no hero with .htaccess, but I'm experiencing a problem that I think might be caused by it. The first symptoms: simple changes to my database (like user IP tracking) got done multiple times per request, while the output by the site looks just fine.
After hours of tracing the problem I finally came to the conclusion that this wasn't caused by the database itself (100% sure) and also not by the extremely simple piece of PHP code I wrote (also 100% sure). Still, the problem occurred on different servers. My only conclusion is that it has to do with my .htaccess files. To me it seems like each request is handled a couple of times before the run that actually causes output.
In my public_html folder I placed the following .htaccess file, which is supposed to redirect every request to a "public" folder:
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L] </IfModule>
In that "public" folder I have another .htaccess file:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?requestedurl=$1 [PT,L] </IfModule>
This file is meant to handle every request using an index.php file. Note: If I rename the index.php file and access it directly, the problem does not occur.
I simply don't get this behaviour and I was hoping anyone on this planet does. Thanks in advance, Hans