首页 > 解决方案 > 如何修复 Google AMP 缓存错误:url 中的未知路径前缀?

问题描述

根据 Google Search Console,我的网站 (thrivous.com) 有大约 170 个有效的 AMP 页面。通过将#development=1 附加到 AMP URL 直接访问它们时,它们都可以正常加载并验证。

但是,当我尝试在 Google AMP 缓存中访问它们时,我在浏览器控制台中收到以下错误消息:

“url中的未知路径前缀”

页面重定向到非缓存的 AMP 页面。

以下是浏览器控制台中的重定向和错误消息示例:

示例截图

我已使用 Google AMP Cache URL API 验证我使用的是正确的 Google AMP Cache URL。它们存在。API 没有报告任何错误。

以下是 Google AMP Cache URL API 返回的信息示例:

{
  "ampUrls": [
    {
      "originalUrl": "https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill",
      "ampUrl": "https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp",
      "cdnAmpUrl": "https://thrivous-com.cdn.ampproject.org/c/s/thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp"
    }
  ]
}

我可以毫无问题地加载 originalUrl 和 ampUrl。当我尝试加载 cdnAmpUrl 时,我在浏览器控制台中得到“url 中的未知路径前缀”。然后页面重定向到 ampUrl。

这曾经工作得很好。而且,事实上,在我运行 Google AMP Cache URL API 之后,它在加载一两个页面后再次正常工作。但随后它返回给出错误消息并重定向。再次运行 API 似乎无法再次修复它。

如何永久修复此问题,以便 Google AMP 缓存在不重定向的情况下正常工作?

标签: amp-html

解决方案


推荐阅读