If you rewrite url with .htaccess, all INSERT request with php is executed twice (unwanted duplication)
My .htaccess :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
And index.php :
<?php define('DB_LOGIN', 'mylogin');
define('DB_PASS', 'mypass');
define('DB_HOST', 'localhost');
define('DB_TYPE', 'mysql');
define('DB_NAME', 'dbname');
$mysql = MySQL_Connect(DB_HOST, DB_LOGIN, DB_PASS);
$mysql_db = MySQL_Select_DB(DB_NAME);
mysql_query("INSERT INTO `pages` (`title`, `slug`) VALUES ('TEST', 'test')"); ?>
After one load of index.php, I have two identical records in mysql. Everything is fine when I delete .htaccess, so the problem should be there. The definition of rewriting in .htaccess is taken from Wordpress - I like it.
I am using Medoo, but the records are still repeating.
So, any suggestion ?:-)
source
share