问题描述
关于此的许多主题,但找不到直接的答案.如何在经过AMP完全验证的网站上对内部链接进行硬编码?
Many topics on this but can't find a straight answer. How do I hard-code an internal link on my fully AMP validated website?
相对链接似乎已转换为绝对链接.我是否必须直接链接到www.google.com/amp/s/网址?
Relative links seem to be converted to absolute.Do I have to link directly to the www.google.com/amp/s/ url?
更新:我尝试过,它只是重定向到我的规范链接.难道我们根本不应该使用内部链接吗?
UPDATE: I tried that, and it just redirects to my canonical link. Are we simply not supposed to use internal links?
推荐答案
Google AMP Viewer内部不支持AMP到AMP的链接.从理论上讲,可以链接到AMP缓存上的版本(使用 AMP缓存URL方案 https://example-com.cdn.ampproject.org/c/s/example.com
).
Officially, AMP-to-AMP linking is not supported inside the Google AMP Viewer. Theoretically, it's possible to link to the version on the AMP cache (using the AMP Cache URL scheme https://example-com.cdn.ampproject.org/c/s/example.com
).
但是,使用AMP的惯用方式是链接回自己来源的规范版本(或AMP版本).
However, the idiomatic way to use AMP would be to link back to the canonical version (or AMP version) on your own origin.
这篇关于AMP页面上的内部链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!