【发布时间】:2011-07-05 23:27:53
【问题描述】:
我正在设置一个 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>
【问题讨论】:
标签: mod-rewrite pathinfo