对于 SEO 而言,.html 扩展名是否比 .php 和 .aspx 更好?

发布于 2024-08-06 20:30:37 字数 63 浏览 9 评论 0原文

对于 SEO 而言,.html 扩展名是否比 .php 和 .aspx 更好?或者少扩展名的 url 比全部更好

Is .html extension better than .php and .aspx for SEO ? or extension less url is better then all

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

失去的东西太少 2024-08-13 20:30:37

该扩展对排名和所有 SEO 影响不大。

您页面的扩展名可能不一定表明内容是如何生成的。 PHP 或 ASPX 虽然通常具有动态内容,但始终可以很容易地呈现静态内容。此外,通过一些相对简单的配置,您可以将所有 .html 页面作为动态页面进行处理(即,index.html 实际上是一个 php 文件)。

我认为您关心的是“静态内容是否比动态内容更受青睐”。 Google 表示不:

GOOGLE:动态网址与静态网址

网络对此存在冲突,因为有些人认为静态内容更可取,因为它不会改变(因此不会使结果无效)。但我倾向于相信大谷歌。

我会更关注页面内容而不是扩展,因为这是机器人花费大部分时间处理的内容。

The extension has little effect on rankings and all that SEO jazz.

Your page's extension may not neccessarily indicate how the content was generated. A PHP or ASPX, whilst normally attributed with dynamic content, can quite easily always render static content. Furthermore, with some relatively easy configuration, you can get all .html pages to be processed as if they were a dynamic page (ie, index.html is actually a php file).

What I think you are concerned with is, "Is static content favoured over Dynamic content". Google says no:

GOOGLE: Dynamic vs Static URLS

The web is conflicted on this, as some people would expect static content to be preferable as it doesn't change (and thus won't invalidate results). But I tend to trust the big google.

I would focus more on the page content than the extension, as that is what the robots spend most of their time crunching.

雨落□心尘 2024-08-13 20:30:37

我不认为扩展会产生任何影响——无论如何,它们可以被伪造,所以谷歌和其他人很可能不依赖这些。

正如“酷 URI 不会改变”的“要省略什么”部分状态:

文件扩展名。这是一种非常常见的扩展名。 “cgi”,甚至“.html”
是会改变的事情。你
该页面可能没有使用 HTML
20年的时间,但你可能想要
今天的链接仍然有效。
建立链接的规范方式
W3C 网站不使用
扩展名。

I don't think extension will make any difference -- they can be faked, anyway, so Google and others most probably don't rely on those.

And as the "What to leave out" section of "Cool URIs don't change" states :

File name extension. This is a very common one. "cgi", even ".html"
is something which will change. You
may not be using HTML for that page in
20 years time, but you might want
today's links to it to still be valid.
The canonical way of making links to
the W3C site doesn't use the
extension.

压抑⊿情绪 2024-08-13 20:30:37

效果将是最小的,但现代趋势是不进行扩展。 URL 对用户来说更加友好。

网址越短,其中的字符就越少,其余单词的“力量”就越大。

The effect will be minimal but the modern tendency is to have no extensions. The URL is then more friendly to the user.

The shorter the url, the fewer characters in it and the the more 'power' the remaining words will have.

不爱素颜 2024-08-13 20:30:37

忘记扩展名。如果您更关心 SEO,请使用 url 重写 - 具有有意义的文件名。您甚至不需要延期。

Forget the extensions. If you are more concerned about SEO, then use url rewriting - with meaningful filenames. You do not even need an extension.

小鸟爱天空丶 2024-08-13 20:30:37

没有扩展总是最好的,因为很酷的网址不会改变。

No extension is always best, since Cool URLs Don't Change.

这个俗人 2024-08-13 20:30:37

可能不会。搜索引擎(即谷歌)将关注内容,而不是技术。

Probably not. The search engines (i.e. Google) are going to focus on content, not technology.

雨后咖啡店 2024-08-13 20:30:37

对于SEO,我不知道。我无法想象它对搜索引擎优化有任何影响(如果有的话,肯定是轻微的)。

但总的来说,我不同意上述观点。如果您返回的只是 HTML,那么这并不重要,但如果您的网站还提供 XML 和/或 JSON(或其他格式),则该扩展是消除您希望返回的格式歧义的好方法。有多种选择。

想象一下 /users/12345.html 返回 ID 为 12345 的用户的个人资料页面的世界。该扩展使您能够调用 /users/12345.json 或 /users/12345.xml。

这也可以通过接受标头来完成,但使用扩展更容易、更透明。

For SEO, I have no idea. I can't imagine it has any impact on SEO (and if it does, surely it is slight).

In general, though, I will disagree with those above. If all you ever return is HTML then it doesn't matter much, but if your site also provides XML and/or JSON (or other formats), the extension is a good way to disambiguate the format you'd like to have returned when there are multiple options.

Imagine a world where /users/12345.html returns a profile page of user with ID 12345. The extension gives you the ability to invoke /users/12345.json or /users/12345.xml.

This can be done with accept headers as well, but using the extension is easier and more transparent.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文