您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

ThinkPHP兑现URL rewrite

2026/1/4 2:21:09发布13次查看
thinkphp实现url rewrite
想用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模块就可以正常访问了
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product