Webkit browsers (Chrome, Safari) are loading pages

2019-07-19 08:38发布

问题:

I have this problem. When you visit page where is PHP code:

$_SESSION['test']++;
echo $_SESSION['test'];

And page is redirected throught .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} ^(.+)\.php$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)\.php index.php?rw=1&page=$1 [QSA,L]

So in non-webkit browsers you will see 1, on next refresh 2, 3, 4, 5 ... But in Chrome or Safari you will see 1, 3, 5, 7, ...

Does anybody have some idea how to solve it? I just need every page redirect to index.php and then load content ... but with every f***ed redirect it has same result ... twice loaded! So when there is a MySQL query, it is processed twice, ... :-/

Thank you! :)

回答1:

problem was, that there were:

<iframe src="#"></iframe>

Webkit has got problems with it, and load pages twice ... so solution is

<iframe src="http://www.example.com/blankPage.html"></iframe>

It is all!!! After 10 hours of madness ... :-/