A
A
Alexey2021-01-11 14:58:45
htaccess
Alexey, 2021-01-11 14:58:45

Why does htaccess reload the page multiple times?

I have this .htaccess

RewriteEngine on

#Удаляем www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#Удаляем index.php
RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ http://%{HTTP_HOST}/$1 [R=301,L]

#Убираем слеш / в конце строки
RewriteRule (.+)/$ /$1 [L,R=301]

#из http в https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

#любая ссылка отправляет на index
RewriteRule ^.*$ index.php [L]


code on the page, every page update I write to the database +1
$param= mysqli_fetch_assoc(mysqli_query($CONNECT, "SELECT * FROM setting WHERE `id` = '1'")); 
    $param_new= $param['numeral'] + 1;
    mysqli_query($CONNECT, "UPDATE setting SET `numeral` = '$param_new' WHERE `id` = '1'");


As a result, after each reload of the page, I have 6 of its launches.
Can you help me make it just one? where to look where to drip? thanks in advance

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