You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04环境下Apache无法识别index.html为默认首页的问题求助

Ubuntu 22.04环境下Apache无法识别index.html为默认首页的问题求助

各位好,我在Vultr上搭了个Ubuntu 22.04的LAMP实例,目前还没改过任何配置,但遇到了个奇怪的问题:明明DirectoryIndex看起来配置是对的,可index.html就是不被当成目录的默认文档。

具体现象:

  • 可以正常访问:https://website.com/resume/index.html
  • 无法正常访问:https://website.com/resume/

我用grep命令查询了所有包含DirectoryIndex的配置内容,结果如下:

root@mine:/etc# grep -r "DirectoryIndex"
apache2/mods-available/dir.conf:    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
apache2/sites-available/http-le-ssl.conf:    DirectoryIndex index.php index.html
apache2/sites-available/http.conf:    DirectoryIndex index.php index.html
apache2/sites-available/https.conf:        DirectoryIndex index.php index.html

有没有大佬能帮忙看看这种情况该怎么解决呀?

备注:内容来源于stack exchange,提问作者mmcglynn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 14:18:04