thinkphp 二级目录安装
2017.10.27 00:09:50字数 182阅读 433

详解:

注意:linux系统对大小写敏感

服务器系统:linux (阿里云服务器)

thinkphp 版本: 3.2

1. 修改nginx配置 (提示找不到控制器,页面空白等问题) 阿里云文件ftp位置:/etc/nginx/conf.d/default.conf

<span style="color: rgb(255, 102, 0);">注意:在Nginx低版本中,是不支持PATHINFO的,但是可以通过在Nginx.conf中配置转发规则实现(如果服务器支持pathinfo则不用以下代码):</span>

增加代码

(根目录下安装)

 location / { // …..省略部分代码
   if (!-e $request_filename) {
   rewrite  ^(.*)$  /index.php?s=$1  last;
   break;
    }
 }

(二级目录安装)

location /youdomain/ {
    if (!-e $request_filename){
        rewrite  ^/youdomain/(.*)$  /youdomain/index.php?s=$1  last;
    }
}

2.修改URL_MODEL连接模式

'URL_MODEL' =>'1', // config.php文件中

3.模板文件命名规范

goods_index.html 错误(linux系统对大小写敏感);Goods_index.html 正确

相关文章:

  • 2021-12-18
  • 2022-02-14
  • 2022-01-17
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案