Home  >  Article  >  Backend Development  >  How to close index.php in tpshop

How to close index.php in tpshop

藏色散人
藏色散人Original
2021-05-19 10:25:481998browse

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

How to close index.php in tpshop

本文操作环境: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视频教程

The above is the detailed content of How to close index.php in tpshop. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn