我只是在学习mvc结构。在我的 mvc 目录中,
我有一个 .htaccess 文件,其中包含:
重写引擎开启
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
这个想法是将所有请求重定向到 index.php,例如:
http://www.domain.com/mvc/test
将会
http://www.domain.com/mvc/index.php?url=test
它工作正常。
但是当我试图通过这个时:
http://www.domain.com/mvc/index
希望转换成
http://www.domain.com/mvc/index.php?url=index
但它不起作用。
我看过一些教程视频,这是可行的。
一定有一些我不知道的设置。