我正在设置一个 php mvc 框架,我想将域之后的任何内容重定向到 index.php/$1 但它不起作用。我启用了 rewrite_module 和 AllowOverride All,我还缺少什么吗?
基本上我希望 url 从这个http://www.example.com/foo/bar
到,http://www.example.com/index.php/foo/bar
所以我可以从 $_SERVER['PATH_INFO']
这就是我所拥有的...
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot c:/wamp/www
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/websites/snugglemvc"
ServerName www.snugglemvc.com
<Directory "c:/websites/snugglemvc">
Order Deny,Allow
Allow from all
AllowOverride all
</Directory>
</VirtualHost>