Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Mod_重写和请求_URI漏斗_Php_Apache_Mod Rewrite - Fatal编程技术网

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版或更高版本,我建议。我发现在这些情况下,例如前端控制器,它的速度稍微快一点。

谢谢!我知道答案很快,但我找不到确切的答案。很有趣,谢谢你,我没听说过这个答案。