查询条已从打开的图形 URL 中删除
关于这个问题: Facebook 的动态生成Open Graph 元标记
我已遵循这些说明,但 api 似乎删除了我的查询字符串,以便传递到聚合中的 url 不包含我的动态信息。如果我将带有查询字符串的 url 输入到调试器中,它不会将其删除并且工作正常。我可以确认我的 og:url 元标记也包含相同的查询字符串,而不仅仅是基本 URL。我做错了什么?
In relation to this question: Dynamic generation of Facebook Open Graph meta tags
I have followed these instructions but the api seems to remove my query string so that the url passed into the aggregation contains none of my dynamic information. If I enter the url with the query string into the debugger it doesn't remove it and works fine. I can confirm my og:url meta tag does also contain the same query string not just the base url. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了类似的问题并像这样解决了它:
所以假设您正在执行帖子请求,就像 tutorial,你的 Javascript 可能看起来像这样:
既然你说你想动态生成元标记,你可能会像这样向 url (passString) 添加一个参数:
这是错误的。
您需要做的就是使 url 成为“漂亮的 url”并使用 htaccess 对其进行解密。所以:
然后你的 htaccess 文件会告诉你的网站,该 url 实际上等于
然后你可以使用 GET 将用户参数与 php 一起存储,然后将其插入你的元标记中。
如果您想知道,在 og:url 元标记的内容中将是:
这有帮助吗?
I was having a similar issue and solved it like this:
So assuming you're doing your post request like it shows in the tutorial, youre Javascript probably looks something like this:
And since you say you want to generate meta tags dynamically, you're probably adding a parameter to the url (passString) there like so:
This is wrong.
What you need to do is to make the url a 'pretty url' and use htaccess to decipher it. So:
Then your htaccess file will tell your site that that url actually equates to
Then you can use GET to store the user parameter with php and insert it however you like into your meta tags.
In case youre wondering, in the og:url meta tag's content will be:
Does that help?