首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Apache2.4中正确地显示index.htm与原始index.html一样?

如何在Apache2.4中正确地显示index.htm与原始index.html一样?
EN

Server Fault用户
提问于 2021-05-29 15:43:24
回答 1查看 1K关注 0票数 0

我正在使用Windows 2016,Apache 2.4。我需要上传静态网页内容,起点是index.htm,而不是index.html

主机文件

代码语言:javascript
复制
127.0.0.1 help.numbooks.com

我的错误

它显示目录列表,而不是正确地呈现htm文件。

我的入口点文件http://help.numbooks.com/index.htm

但是使用http://help.numbooks.com它会显示目录列表,这是预料不到的。

我的尝试

代码语言:javascript
复制
<VirtualHost *:80> 
  ServerName help.numbooks.com
  DocumentRoot "C:\vy\Frameless"
  DirectoryIndex index.htm
 
  <Directory "C:\vy\Frameless">
      AllowOverride All
  </Directory> 
    ErrorLog "C:\help.log"
    CustomLog "C:\help_custom.log" common  
</VirtualHost>

(当然,我在更改配置后重新启动Apache服务)。如何在Apache2.4中正确地显示index.htm与原始index.html一样?

EN

回答 1

Server Fault用户

发布于 2021-05-29 15:54:22

httpd.conf中,更改

代码语言:javascript
复制
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

代码语言:javascript
复制
<IfModule dir_module>
    DirectoryIndex index.htm
</IfModule>
票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1065081

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档