Skip to content
网游世界
网游世界

吾生有涯,而知无涯。

  • 首页
  • PHP
    • ThinkPHP
    • FastAdmin
    • webman
  • JavaScript
    • jQuery
    • AdminLTE
  • Free Pascal
  • Java
    • JeeSite
    • 若依
    • ruoyi-vue-pro
  • 其它
    • 操作系统
    • 树莓派
    • 前端
    • Null
  • 关于
网游世界

吾生有涯,而知无涯。

Windows BT 面板伪静态设置不生效

3Vshej, 2024年1月30日 周二

原来是在 Linux 下使用的,近期在 Windows 中安装了 BT 面板,随之的问题也来了。

在站点伪静态中,像 ThinkPHP 的,

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

像 wordprss 的:

location / {
    index index.html index.php; 
    if (-f $request_filename/index.html){ 
        rewrite (.*) $1/index.html break; 
    } 
    if (-f $request_filename/index.php){ 
        rewrite (.*) $1/index.php; 
    } 
    if (!-f $request_filename){ 
        rewrite (.*) /index.php; 
    } 
} 

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

都是,只要选择就可以使用。

但现在却不行,访问直接报 404。

解决方法:在 BT 面板Nginx 配置目录,如 D:\BtSoft\nginx\conf\php,编辑相应版本的 conf 文件。

如,D:\BtSoft\nginx\conf\php\74.conf

打开后,注释掉 try_files

location ~ \.php(.*)$ {
    # try_files $uri =404;
    fastcgi_pass   127.0.0.1:20074;
    fastcgi_index  index.php;

    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO  $fastcgi_path_info;

    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

重新启动 PHP-FPM。

参见:https://www.bt.cn/bbs/thread-112198-1-1.html

相关文章:

  1. Manticore Search 简单入门 Manticore Search 是一个使用 C++ 开发的高性能搜索引擎,创建于 2017 年,其......
  2. 世界,您好! 这是我的新博客,用于记录日常学习、工作中的收获和总结。...
  3. OAuth 的权限问题与信息隐忧 以 QQ 登陆和微博登陆为代表的“一键登陆”背后不仅仅是登陆这么简单,它还默认获取了你的其他隐私资料......
  4. Layui 表单提交报错 Uncaught TypeError: ‘checkValidity’ called on an object that does not implement interface HTMLButtonElement Layui 表单提交报错: Uncaught TypeError: ‘checkVali......
其它 操作系统 BT 面板Nginx伪静态

文章导航

Previous post
Next post

近期文章

  • Android Studio Gradle 配置国内镜像
  • 为什么重新发明轮子
  • ruoyi-vue-pro 匿名访问
  • VUE 中接收 code 异常
  • 关于 AI

归档

  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 11 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 8 月
  • 2024 年 7 月
  • 2024 年 6 月
  • 2024 年 5 月
  • 2024 年 4 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2024 年 1 月
  • 2023 年 12 月
除非特殊说明,本站作品采用知识共享署名 4.0 国际许可协议进行许可。
豫公网安备 41010402002622号 豫ICP备2020029609号-3
©2025 3Vshej