【发布时间】:2015-07-28 08:53:11
【问题描述】:
我的 Sinatra 应用程序具有典型的文件层次结构: 根包含:
文件“hc.rb” 文件“endpoints.yml” 目录“意见” 目录“公共”
“视图”包含 .erb 文件
公共目录包含:
文件“style.css” 目录“图像”
在目录图像中,我有 favicon 和 404 图片。
这里是部分代码:
not_found.erb
<center><img src="images/404.png" alt="404 Not Found"></center>
hc.rb
not_found do
erb :not_found
end
layout.erb
<!doctype html>
<html lang="en">
<head>
<title></title>
<link rel="icon" href="images/favicon.ico"/>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
</header>
<section>
<%= yield %>
</section>
</body>
</html>
当我输入 localhost:[port]/smthnonexisting
我在屏幕上看到 404 图像
但是当我输入附加级别时
localhost:[端口]/smthnonexisting/andsmthmore
我没有看到图像,我只看到 404 Not Found 和损坏的图像 ico。
可能是什么原因?
谢谢
【问题讨论】: