【问题标题】:Html file is not working on php directory script websiteHtml 文件在 php 目录脚本网站上不起作用
【发布时间】:2017-07-24 11:17:40
【问题描述】:

我有 php 网页目录。我正在尝试在其中创建带有 html 模板的子文件夹,但问题是服务器显示以下错误“Apache Server at www.mydomain.com Port 80”。

我有默认的空 .htaccess 文件。

这是我上传 html 文件的路径。

http://www.mddir.com/movie/top-indian-movies/

请帮我制作这个 html 文件。

【问题讨论】:

  • “显示以下错误...”-但这不是错误吗?您已标记您的问题.htaccess - 您有.htaccess 文件吗?请将此添加到您的问题中。 “这就是文件夹结构的样子”——你的文件夹结构是什么样的??
  • 是的。我有默认的空 .htaccess 文件。这是我上传 html 文件的路径。 mddir.com/movie/top-indian-movies

标签: php html apache .htaccess


【解决方案1】:

显示以下错误:“Apache 服务器位于 www.mydomain.com 端口 80”。

这不是错误,只是访问目录时的目录列表,目录索引文档不可用。

您似乎没有启用目录索引(或者它没有为index.html 设置)。

我猜你也不想看到目录列表。

尝试将以下内容添加到您的 .htaccess 文件中:

# Disable directory listings
Options -Indexes

# Load index.html when requesting the bare directory
DirectoryIndex index.html

【讨论】:

  • 真棒@user82217。 :)。这是工作。你节省了我很多时间。非常感谢您的快速回复。
猜你喜欢
  • 2011-01-13
  • 2016-02-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多