You appear to be using both mod_rewrite
and RedirectMatch
to perform two different redirects:
This appears to redirect any request starting with app.php
to the base website URL:
RewriteRule ^app.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
This appears to be redirecting any request to /
coming in to /app.php/
:
RedirectMatch 302 ^/$ /app.php/
These rules seem to be in direct conflict with one another. If you try to request either the root website path /
, or /app.php
you are going to get into a redirect loop.
This condition tells Apache to track redirects internally in order to prevent a redirect loop:
RewriteCond %{ENV:REDIRECT_STATUS} ^$
However that only works as long as you have one server. When you have multiple load-balanced servers they can't track if a redirect has been issued by another server in the pool.
I suggest taking a look at these redirect rules and only using one of them depending on what your specific needs are.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…