我正在使用 MAMP(在发布之前)尝试将我的PrintMyName.doccarchive框架的内容托管到我的网站中。
据我所知,我已遵循文档中描述的所有步骤:
创建并修改了 .htaccess 模板以匹配我的文档存档的名称
# Enable custom routing.
RewriteEngine On
# Route documentation and tutorial pages.
RewriteRule ^(documentation|tutorials)\/.*$ PrintMyName.doccarchive/index.html [L]
# Route files and data for the documentation archive.
#
# If the file path doesn't exist in the website's root ...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ... route the request to that file path with the documentation archive.
RewriteRule .* PrintMyName.doccarchive/$0 [L]
将代码添加到我的主 index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>HELLO THERE!</h1>
<button onclick="location.href = '/documentation/index.html'">PrintMyName Documentation!!!</button>
</body>
</html>
当我单击按钮时,问题就出现了。我看到 htaccess 正在工作,但是在为我的文档加载内容时,我确实看到了以下错误:
我确实想象在尝试映射/重写时出现了一些问题(请原谅我对服务器术语的了解不足),因为 index.html.json 显然不存在:
地图(再次抱歉)是否试图将出现的PrintMyName替换为index.html???
有什么想法吗?