大网数据广告活动
网站运营与故障问答

Locate sitemap at HTTP or HTTPS?

· 52CE 我爱测

Our homepage has a 301 redirect from HTTP to HTTPS but all other pages on the site are on HTTP. (1) Should the sitemap be located at HTTPS and is there any problem if we: (2) include the HTTPS version of homepage (not including t…

问题原文

原帖链接 · user33692 · CC BY-SA 3.0

Our homepage has a 301 redirect from HTTP to HTTPS but all other pages on the site are on HTTP.

(1) Should the sitemap be located at HTTPS and is there any problem if we:

  • (2) include the HTTPS version of homepage (not including the HTTP homepage)
  • (3) include the HTTP of all other pages within the HTTPS sitemap

I have read conflicting information about including both HTTPS and HTTP in the same sitemap so any info is appreciated here.

已采纳解答

原帖链接 · MrWhite · CC BY-SA 3.0

A single XML sitemap should not contain a mix of HTTP and HTTPS URLs (i.e. essentially different locations as far as the search engines are concerned). So, the sitemap located at http://example.com/Sitemap.xml should only contain URLs starting http://example.com/ and similar for the HTTPS sitemap.

From sitemaps.org:

Q: My site has both "http" and "https" versions of URLs. Do I need to list both?
No. Please list only one version of a URL in your Sitemaps. Including multiple versions of URLs may result in incomplete crawling of your site.

From GWT Sitemap Errors:

URL not allowed
https://www.example.com/ — it's using a different protocol (https rather than http)

So, you would seem to need 2 sitemaps. One for HTTPS and the other for HTTP. Although if you only have 1 URL in your HTTPS sitemap (your homepage!) then whether you need an HTTPS sitemap at all is debatable - although it could help with reporting in GWT.

To answer your specific questions...

(1) Should the sitemap be located at HTTPS and is there any problem if we:

Well, yes and no. You would need a sitemap at both, but primarily at HTTP.

(2) include the HTTPS version of homepage (not including the HTTP homepage)

Include the HTTPS version of the homepage in the HTTPS sitemap. You state you have a redirect to the HTTPS homepage, so there is no HTTP homepage. So, the HTTP homepage should not appear in any sitemap.

(3) include the HTTP of all other pages within the HTTPS sitemap

No. You would need a separate HTTP sitemap.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2013-11-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。