The mod_rewrite rule for bootstrap causes index.php to load twice

I worked on a project that uses frontloader to handle all requests (Routing domain.com/args/go/here in Index.php? Req = args / go / here), and it worked very well ... Or should I say I thought this happened - I recently added a new logger, and to check it, I posted a test log message in index.php. This message was written to my log file twice, every time I reloaded the page, and after a lot of debugging, I found the reason for my .htaccess file - for some reason, it loads index.php twice for each request.

Here is my .htaccess:

RewriteEngine On
RewriteBase /site/beta/ #I added this after I discovered the bug
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^index\.php$ #This too. Doesn't work
RewriteRule ^(.*)$ index.php?args=$1 [L]

I also tried:

FallbackResource /site/beta/index.php

(Index.php , , , 127.0.0.1/site/beta/admin/controls/- , /index.php) .

- ? IRC, , . ( , )

+3
2

, mod_rewrite? RewriteLog rewriteLogLevel (9), , 2 ?

, " , 2 ", -: IMG src.

- HTML

<IMG SRC="">

css ( ) a:

url()

. HTTP , URL- GET ( url() css GET) URL-, ( POST, POST).

, mod_rewrite 2 . Firebug LiveHTTP. index.php 2 . HTTP- telnet- , .

+6

, (, apache) favicon.ico. , . , , , , .

0

Source: https://habr.com/ru/post/1784030/


All Articles