【问题标题】:Creating custom error page in apache在apache中创建自定义错误页面
【发布时间】:2014-02-22 09:40:19
【问题描述】:

我创建了一个自定义 404 错误页面。

<h1>Page not found</h1>

但是当我重新加载/重新启动 apache2 时,它给了我这个:

apache2: Syntax error on line 234 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/conf.d/errors/404.html: /etc/apache2/conf.d/errors/404.html:1: <h1>Page> was not closed.
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

谁能说说问题出在哪里?

【问题讨论】:

  • 第234行是:包含conf.d/
  • 你能显示 conf.d 文件吗?使用过ErrorDocument?它采用绝对 URL 路径而不是文件路径。

标签: linux apache ubuntu http-status-code-404


【解决方案1】:

似乎在 /etc/apache2/conf.d/errors/404.html 文件中您没有正确关闭

标记。试试下面。

页面

请注意这里。

【讨论】:

  • 如你所见,我关闭了它。
猜你喜欢
  • 2013-02-13
  • 2014-02-28
  • 2015-07-25
  • 1970-01-01
  • 2014-11-10
  • 2010-09-13
  • 2011-06-07
  • 2019-01-18
  • 1970-01-01
相关资源
最近更新 更多