想用thinkphp实现url rewrite,工程hello的目录结构如下:
http://localhost/hello/index.php/user/login,这个link是可以的。
http://localhost/hello/user/login,这个link就不可以。
http://localhost/hello/user/login
apache httpd.conf文件的修改:
启用了loadmodule rewrite_module modules/mod_rewrite.so
options followsymlinks
allowoverride all
order allow,deny
allow from all
修改allowoverride为all
文件conf/config.php的内容如下:
2
);
添加了.htaccess,内容如下:
rewriteengine on
rewritecond %{request_filename} !-d
rewritecond %{request_filename} !-f
rewriterule ^(.*)$ index.php/$1 [qsa,pt,l]
请问应如何使http://localhost/hello/user/login可以访问?多谢!
------解决方案--------------------
order allow,deny
deny from all
有吗?
------解决方案--------------------
在apache下只需要开启mod_rewrite模块就可以正常访问了
