通过XML文件重定向URL



我正在寻找如何使用我的xml文件-进行url重定向的答案

<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xsi:schemaLocation="
http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with PRO Sitemap Service https://pro-sitemaps.com -->
<url>
<loc>https://www.example.com/</loc>
<lastmod>2020-07-08T11:16:49+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>1.0000</priority>
</url>

例如,我需要从";https://www.example.com/"至";https://www.example.com/somepage"。

我在XMLSchema中做了一些东西来放置另一个链接,特别是目标链接,但我不知道我需要把哪种类型放在那里,例如loc链接是"lt;xsd:element-name="loc";type=";tLoc"/>";,但我根本不知道这是不是一个好动作。所以,请真的帮我做那个疯狂的XML事情:P非常感谢!

站点地图XML格式没有描述重定向的规定。

如果文档已移动,请将其新位置放在<loc>元素中,并将HTTP服务器配置为对旧位置发出HTTP 301 moved Permanently(或302 moved Temporary(响应。

最新更新