Mod_rewrite:将所有内容都指向一个PHP文件

时间:2010-03-04 16:42:52

标签: apache mod-rewrite

我有这条规则:

<IfModule mod_rewrite.c>
 RewriteEngine On

 RewriteCond %{REQUEST_FILENAME} !index.php

 RewriteRule ^(.*)$ index.php?req=$1
</IfModule>

如果我请求myhost/view/blah等不存在的目录,一切正常,但是当我在myhost/module这样的网址中输入一些现有目录时,我会被重定向到module/?req=module而不是留在{ {1}}

我做错了什么? 我需要一些东西将所有内容重定向到index.php(当然除了index.php)。

1 个答案:

答案 0 :(得分:1)

DirectorySlash可能会导致此行为。尝试禁用它。