首页 > Web开发 > 详细

thinkphp框架 url 去除index.php

时间:2017-12-17 20:31:13      阅读:228      评论:0      收藏:0      [点我收藏+]

1.在apache配置文件 httpd.conf找到mod_rewrite.so ,去除前面的井号

技术分享图片

2.在多站点配置文件中(httpd_vhosts.conf)修改None为All,重启apache

技术分享图片

3.在项目根目录编写.htaccess文件内容为

  1. <IfModule mod_rewrite.c>
  2. RewriteEngine on
  3. RewriteCond %{REQUEST_FILENAME} !-d
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
  6. </IfModule>

4.在项目应用配置文件中(Application/Common/Conf/config.php)写入

return array(

  ‘URL_MODEL‘=>2  

);

配置完成.........

thinkphp框架 url 去除index.php

原文:http://www.cnblogs.com/kevinggk/p/8052883.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!