Mod rewrite Concrete5中漂亮URL的mod_重写规则

Mod rewrite Concrete5中漂亮URL的mod_重写规则,mod-rewrite,concrete5-8.x,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 .

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>

重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}/index.html-F
重写cond%{REQUEST_FILENAME}/index.php-F
重写规则。index.php[L]
但是
重写规则
为什么起作用

  • 为什么替换字符串出现在URL的开头,以及 额外的“/”来自哪里?例如
    http:///foo
    ==>
    http:///index.php/foo
  • 为什么此规则不要求[QSA]保留查询字符串参数 该规则客观上确实正确地处理了这两种情况,但我无法从中推断其原因,并希望一些耐心的讲师能阅读farking手册的相关章节