Does an AMP url retain the query parameters?

大憨熊 提交于 2021-02-08 10:28:46

问题


I've seen this question asked before but a straight answer is hard to find. I've heard both sides of the story from reliable sources. Documentation is limited but I did find this article from Google.

https://developers.google.com/amp/cache/overview#query-parameter-example

TLDR:

Query parameter example The AMP Cache URL format can also include parameters in the query string. The following is an HTTPS example with parameters: https://example-com.cdn.ampproject.org/c/s/example.com/g?value=Hello%20World

Can I use, say $_GET['utm_source'] in PHP on a page I want cached with AMP?


回答1:


Yes, the AMP cache supports query parameters. Here is an example:

https://ampbyexample-com.cdn.ampproject.org/c/s/ampbyexample.com/g?value=Hello%20Alice https://ampbyexample-com.cdn.ampproject.org/c/s/ampbyexample.com/g?value=Hello%20Bob

Both links point to the same page, but render different content based on the query param. The AMP Cache mirrors this behavior.



来源:https://stackoverflow.com/questions/57205722/does-an-amp-url-retain-the-query-parameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!