【发布时间】:2017-02-27 21:25:07
【问题描述】:
我有一个索引文件存储在我的服务器上的 public_html 文件夹下,因此可以公开访问。
那个地址是http://example.com/randomlocation/anotherlocation/index.html
在看起来像 public_html/randomlocation/anotherlocation/index.html 的服务器上
但是问题是我的用于显示和运行页面的 css、js 和 img 文件位于公共 html 部分之外的另一个级别,我无法指定到达那里的相对或基本路径,这将是这样的:
home/site/folder/randomfolder/anotherfolder/location/styles.css
例如:
<link rel="stylesheet" href="http://example.com/randomfolder/another folder/assets/css/emojione.min.css"/>
<link rel="stylesheet" href="/home/examplesite/folder/folder/folder/folder/assets/css/styles.css" />
似乎不起作用。我已经尝试了“/”相对路径的所有变体,但无法弄清楚我缺少什么才能提取这些文件。
【问题讨论】:
-
你不能这样做,这将是一个巨大的安全问题。