gpt4 book ai didi

html - 超链接谁的路径只是一个正斜杠 (/)

转载 作者:搜寻专家 更新时间:2023-10-31 02:25:16 24 4
gpt4 key购买 nike

我被要求对 friend 的公司网站进行一些更改。它为每个页面的页眉使用 PHP 插入文件,这很有用,因为导航等在每个页面上都是相同的。

以下代码指定每个页面上的公司 Logo :

<div id="logo"> 
<a href="/"></a>
</div>

如您所见,a 标记的 href 包含 正斜杠 /小路。

该链接工作正常,并连接到 index.php 页面。

我想知道它是怎么做到的?鉴于域的默认页面由服务器配置文件控制,这是链接到指定默认页面的快捷方式吗?

我以前从未见过这样做,而且我似乎找不到任何相关文档。感谢您提供的任何信息。

最佳答案

该链接将您带到公共(public)根目录,然后启动默认文件。

它是绝对路径的相对等价物,例如http://stackoverflow.com/

In Linux and other Unix-like operating systems, a forward slash is used to represent the root directory, which is the directory that is at the top of the directory hierarchy and that contains all other directories and files on the system. Thus every absolute path, which is the address of a filesystem object (e.g., file or directory) relative to the root directory, begins with a forward slash.

Forward slashes are also used in URLs (universal resource locators) to separate directories and files, because URLs are based on the UNIX directory structure. A major difference from the UNIX usage is that they begin with a scheme (e.g., http or ftp) rather than a root directory represented by a forward slash and that the scheme is followed directly by the sequence of a colon and two consecutive forward slashes to indicate the start of the directories and file portion of the URL.

通过:http://www.linfo.org/forward_slash.html

关于html - 超链接谁的路径只是一个正斜杠 (/),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7612888/

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