我在为我的网站实现 MVC 设计模式时遇到了一个问题。我在文件夹中有一个名为“svce”的文件夹/www(这是我的DOCUMENT_ROOT)。我创建了一个.htaccess文件并在其中编写了以下代码:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$index.php?url=$1 [QSA,L]
然后我编辑了httpd.conf文件并取消了LoadModule rewrite_module modules/mod_rewrite.so.
即使这样做了,RewriteEngine也不行。当我尝试使用 访问应用程序http://localhost/svce/blahblah.php时,它给了我一个默认的 404 错误页面。
IT 应该只向我显示/svce目录中的索引页。