【发布时间】:2018-03-21 23:07:16
【问题描述】:
我已经建立了一个非常简单的网页,其中包含一些 css 文件和一些由其他人提供给我的 html 包含文件。
我服务器上的目录树如下所示:
css/
global.css
site.css
includes/
header.html
footer.html
nav.html
index.html
subdir/
index.html
我的所有 html 文件(includes 目录中的文件除外)都包含此类内容(除其他外)
...
<link href="css/global.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
<body>
<!--#include file="includes/header.html" />
...
</body>
...
此设置适用于我拥有的顶级index.html 页面,但在其他任何页面(即subdir/index.html)上都失败了。我在浏览器中收到一条消息:
[an error occurred while processing this directive]
我知道 apache 网络服务器只是找不到 css 和包含文件(我已经检查了日志),但我不知道在哪里告诉它去寻找它们。我尝试过这样的事情:
<link href="../css/global.css" rel="stylesheet" />
但它也不起作用。
我是网络编程的新手,所以如果这是过于基本的东西,我深表歉意。
【问题讨论】: