AMP网址是否保留查询参数? [英] Does an AMP url retain the query parameters?

查看:112
本文介绍了AMP网址是否保留查询参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前看过这个问题,但是很难找到一个直接的答案.我已经从可靠的消息来源听到了故事的两面.文档有限,但我确实从Google找到了这篇文章.

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:

查询参数示例AMP缓存URL格式还可在查询字符串中包含参数.以下是带有参数的HTTPS示例: https://example-com.cdn.ampproject.org/c/s/example.com/g?value=Hello%20World

我可以在要使用AMP缓存的页面上在PHP中使用 $ _ GET ['utm_source'] 吗?

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

推荐答案

是的,AMP缓存支持查询参数.这是一个示例:

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

两个链接均指向同一页面,但根据查询参数呈现不同的内容.AMP缓存反映了此行为.

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

这篇关于AMP网址是否保留查询参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆