开发者

Create sitemap with both http and https protocol

开发者 https://www.devze.com 2023-03-25 15:32 出处:网络
I have a problem with sitemap. My site use http/https protocols. When I try to generate sitemap using http://www.xml-sitemaps.com/ and send any http link generated just first level links.

I have a problem with sitemap. My site use http/https protocols. When I try to generate sitemap using http://www.xml-sitemaps.com/ and send any http link generated just first level links. For example I have two level pages: fist level- http://testserver/users which has a lot of link user profile. But all users profile link looks like https://testserver/smith,开发者_Python百科 https://testserver/white etc

So generated sitemap looks like

<url>
    <loc>https://dtestserver/users</loc>
</url>

And no second level link was`t generated.

If I use this link https://testserver/smith, then sitemap contain all menu link with https, but not contains another user page links https://testserver/white

Why it happens?


can you simply ignore the protocol?

<loc>//dtestserver/users</loc>


You can't mix http and https in XML sitemaps.

One solution e.g. A1 Sitemap Generator uses (in default config) is to alias and convert URLs with the non-root-protocol (say https) to the is-root-protocol (http)

So if root is http://example.com then https://example.com/test1.html becomes http://example.com/test1.html

But the overall rule is: You can not mix protocols in XML sitemaps

0

精彩评论

暂无评论...
验证码 换一张
取 消