D
D
DERBIAGLOBALISTO2019-10-23 22:46:53
PHP
DERBIAGLOBALISTO, 2019-10-23 22:46:53

What can cause the script to run twice?

I can't track down what the problem is. The script is executed twice (the same script), because of this, records are duplicated in the database and this has a very bad effect on the project ... I think the problem itself is not in the script, but in the host or in the server settings, maybe in the . htaccess... I'm asking for help, otherwise I don't know what to do at all, I've already tried everything, I just can't track this problem.
I will also say that this does not always happen, but only in about 5% of the cases, and because of this it becomes even more incomprehensible what the problem is - why sometimes everything works fine, and sometimes there are duplicates. I would be very grateful to anyone who can help me!
Here is the .htaccess file, maybe there is something wrong in it? I heard that this can happen because of the favicon.ico file...

AddDefaultCharset utf-8

DirectoryIndex index.php

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^site.tk$ [NC]
  RewriteCond %{REQUEST_URI} !^/favicon.ico
  RewriteRule ^(.*)$ http://site.ru/$1 [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www.site.tk$ [NC]
  RewriteCond %{REQUEST_URI} !^/favicon.ico
  RewriteRule ^(.*)$ http://www.site.ru/$1 [R=301,L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question