apache - REQUEST_URI 填充有默认文件 (DirectoryIndex) /index.html
问题描述
在使用 Centos 迁移到新服务器后,一些行为发生了变化。
当获取http://example.com(没有 index.html)时,环境变量 REQUEST_URI 包含“/index.html”。
我希望:
获取http://example.com时,REQUEST_URI 为“/” 。
获取http://example.com/index.html时,REQUEST_URI 为“/index.html” 。
这对我的 .htaccess 有影响(重写器对'index.html'而不是'空字符串'做出反应)以及我的脚本(Perl $ENV{'REQUEST_URI'})
当仅获取http://example.com时,如何激发 REQUEST_URI 填充“/” ?
解决方案
似乎问题仅在 Plesk 'Hosting settings' PHP Support 设置为
'将 PHP 作为 nginx 服务的 FPM 应用程序运行'
当我将其更改为
'将 PHP 作为 Apache 提供的 FPM 应用程序运行'或'将 PHP 作为 Apache 提供的 FastCGI 应用程序运行'
这里没有问题。
推荐阅读
- mysql - 我有一个包含不同部分的短语,我需要使用 SQL 将它们拆分,三个不是短语中的分隔符
- c++ - 一个结构的所有对象的条件语句而不写每一个?
- android - 将高程(阴影)添加到 ExtendedFloatingActionButton
- python - 使用 pyelftools 抓取程序头信息
- json - Microsoft Bot Framework API 创建与多个成员的对话
- python - 传递默认参数的pythonic方式是什么?
- sql - 何时使用不存在的插入选择?
- c# - 循环内的异步操作 - 如何保持对执行的控制?
- python - 使用 Gorilla 包进行猴子修补,应用于超类方法
- java - 在电影院 java 中查找连续可用的免费座位