输入banner图图片脚本导航/分类

tpshop怎么关闭index.php

tpshop关闭index.php的方法:1、修改“Application\Common\Conf\config.php”文件代码;2、修改根目录下的“.htaccess”文件。

本文操作环境:windows7系统、PHP7.1版,DELL G3电脑

TPshop隐藏index.php

有些朋友提到关于TPshop 隐藏index.php 一问题, 可以修改 Application\Common\Conf\config.php 文件代码

'common',
    'AUTH_CODE' => "TPSHOP", //安装完毕之后不要改变,否则所有密码都会出错
    //'URL_CASE_INSENSITIVE' => false, //URL大小写不敏感
    'LOAD_EXT_CONFIG'=>'db,route', // 加载数据库配置文件
    'LOAD_EXT_CONFIG'=>'db', // 加载数据库配置文件
    'URL_MODEL'=>2, // 如果需要 隐藏 index.php  打开这行"URL_MODEL"注释 同时在apache环境下 开启 伪静态模块,  如果在nginx 下需要另外配置,参考thinkphp官网手册

有些环境刚修改上面还是不行,需要另外修改根目录下的 .htaccess 文件

Options +FollowSymlinks
  RewriteEngine On
 
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]  
  RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]

原来的

RewriteRule ^(.*)index.php/1 [QSA,PT,L]

改成

RewriteRule ^(.*)index.php?s=1 [QSA,PT,L]

重启apache 试试。

对于nginx 用户 请查看thinkphp 官网手册说明

推荐学习:《PHP视频教程》

以上就是tpshop怎么关闭index.php的详细内容,更多请关注gxlcms其它相关文章!