Php Mod_重写和请求_URI漏斗
我想为我的网站使用前端控制器设计模式,所以我想把所有东西都指向,比方说,Php Mod_重写和请求_URI漏斗,php,apache,mod-rewrite,Php,Apache,Mod Rewrite,我想为我的网站使用前端控制器设计模式,所以我想把所有东西都指向,比方说,index.php 在index.php中,我想将请求URI分成不同的部分,然后决定接下来要做什么 如何编写我的.htaccess来执行此操作 Wordpress正是这样做的: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{RE
index.php
在index.php
中,我想将请求URI
分成不同的部分,然后决定接下来要做什么
如何编写我的
.htaccess
来执行此操作 Wordpress正是这样做的:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
如果您运行的是Apache 2.2.17版或更高版本,我建议。我发现在这些情况下,例如前端控制器,它的速度稍微快一点。谢谢!我知道答案很快,但我找不到确切的答案。很有趣,谢谢你,我没听说过这个答案。