【发布时间】:2016-12-12 11:08:01
【问题描述】:
我想要一个在每个请求中执行的文件,比如说index.php
RewriteRule ^(.*)$ index.php [QSA]
然而,如果它碰巧有index2.php,我们宁愿执行那个文件。换句话说,如果index2.php 存在,它会覆盖默认行为。所以我会这样写:
RewriteRule ^(.*)$ index2.php [QSA]
RewriteRule ^(.*)$ index.php [QSA]
但如果index2.php 不存在,则会失败
RewriteRule ^(.*)$ index2.php [L]
RewriteRule ^(.*)$ index.php [L]
也是这样。 Index2.php 不需要存在,但index.php 确实存在并且将永远存在
【问题讨论】: