The PHP script was accessed once in the browser, but executed twice

the code for accessing index.php
index.php in the browser is as follows:
file_put_contents (". / log.log","abcn",FILE_APPEND);


abc
abc

appears when
log.log visits this page once in a browser.

this happens from time to time, for some unknown reason, but not in non-url rewriting mode

Php
Mar.25,2021

is there a mistake between url redirection and url rewriting?


I guess the reason is that when requesting index by default,
the browser will have two requests

.
  • one is the
  • that requests the favicon.ico
  • one is a normal index request

maybe your redirection rule is not perfect, you should set a separate rule.
in fact, you can find out

by looking at the debugging tools of the browser.

rewrite rule issues

Menu