绝对链接和相对链接:技术差异 [英] Absolute vs Relative Links : Technical Difference

查看:122
本文介绍了绝对链接和相对链接:技术差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪个是更好的选择,或者在速度或SEO,反向链接等其他问题上没有区别

Which is better option or there is no difference in terms of speed or other issues like SEO, Backlinks

href ="http://www.example.com/contact"

href="http://www.example.com/contact"

href ="../../contact"

href="../../contact"

根据我的观察,绝对路径使用从左到右的路径,最后移动到最右侧的位置,如http//www.example/contact

From what i observe, Absolute paths uses paths from left to right finally move to rightmost position as in http//www.example/contact

fpr相对路径:首先,它获取当前位置,然后根据../../contact或../blog/articles移至该位置.

fpr relative paths: first it gets the current location, then based ../../contact or ../blog/articles move there.

从技术上讲,这是较快的,如答案中所述,速度差是可忽略的/分钟.但是它是如何工作的

Technically which is faster, as mentioned in answers speed difference is ignorable/minute. But how it works

推荐答案

对于搜索引擎和其他处理Web上交付的HTML页面的软件,速度或速度没有任何(可衡量的)差异.

There is no (measurable) difference in speed or anything as regards to search engines and other software that processes HTML pages as delivered on the web.

原因是,使用相关软件的作者已知的定义明确的算法将相对URL解析为绝对URL.因此,当您的页面包含href="../../contact"时,它将使用当前的基本URL进行解析,并且此操作所需的纳秒数是可以忽略的.

The reason is that relative URLs are resolved to absolute URLs applying well-defined algorithms that are known to authors of relevant software. So when your page contains href="../../contact", it will be resolved using the current base URL, and the nanoseconds required for this are ignorable.

authoring 点开始使用相对URL还是绝对URL是一个不同的问题,并且已经提到了以下问题:

The use of relative vs. absolute URLs from the authoring point is a different issue, and well covered in the question already mentioned: Absolute vs relative URLs

这篇关于绝对链接和相对链接:技术差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆