gpt4 book ai didi

php - 无法链接到上一层的 index.html

转载 作者:太空宇宙 更新时间:2023-11-04 11:44:15 24 4
gpt4 key购买 nike

这是我凌乱的主机根文件夹的结构;我希望尽快清理干净;

根目录(文件夹)

.....AllWebsites(文件夹)

.......网站1(文件夹)

index.html//请注意下面的这些html文件不在它们自己的文件夹中。所以他们松散地坐在 website1 文件夹中;

index2.html

index3.html

许多其他 html 文件

phpFolder(文件夹)

........index.php (file)//这是我的着陆页

网站2(文件夹)以及其他网站的更多文件夹

所以我只是想在我的 index.php 上使用一个名为“第二个登陆页面”的按钮来链接到 index.html。所以我试着写;

<li><a href='/website1/index.html'><strong>Second Landing Page</strong></a></li>

但是我收到 404 错误。然后我试着写;

href='/allWebsites/website1/index.html

href='//website1/index.html

//我希望 2 条斜线能让我提升一个级别,但没有奏效,还有许多其他变化都没有任何运气。这可能是一个非常简单的问题,但对我在编写这些网站时学习的人来说不是。

解决此问题的一种方法是在 phpFolder 中放置一个名为 htmlFolder 的新文件夹,然后粘贴所有 html 文件,包括 index.html。那我就简单地写;

<li><a href='/htmlFolder/index.html'><strong>Second Landing Page</strong></a></li>

但这将是一场噩梦,所以我很感激任何帮助,只要弄清楚如何链接到它当前所在的 index.html > 在名为 website1 文件夹的 phpFolder 上方的文件夹中。

最佳答案

您要查找的术语是“相对路径”。

取自http://www.boogiejack.com/server_paths.html

Relative paths

关于php - 无法链接到上一层的 index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31110472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com