在Concrete5中

时间:2017-04-02 19:53:40

标签: mod-rewrite concrete5-8.x

Concrete5提供此配置转储,在所有URL的开头插入一个省略的'index.php /':

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>

但为什么RewriteRule有用?

  1. 为什么替换字符串位于URL的开头,并且 额外的'/'来自哪里? E.g http://<host>/foo ==&gt; http://<host>/index.php/foo
  2. 为什么此规则不需要[QSA]保留查询字符串参数?
  3. 该规则客观上确实正确地处理了这两种情况,但我不能从Apache documentation推断它为什么会这样做,并且会感谢一些患者导师向我阅读该手册的相关章节。

0 个答案:

没有答案
相关问题