[英]Share link on Facebook is strangly encoded
How do you share a link on Facebook? 您如何在Facebook上共享链接? I have no problem with submitting a top level URL (site.com).
提交顶级URL(site.com)没有任何问题。 When I try to share a deeper link (site.com/anything), Facebook incorrectly encodes the link.
当我尝试共享更深的链接(site.com/anything)时,Facebook错误地对链接进行了编码。 I tried pre-encoding my URL with Javascript's
escape()
, but Facebook doesn't like that either. 我尝试使用Javascript的
escape()
对URL进行预编码,但Facebook也不喜欢。
Deeper links work fine, provided that the link actually resolves to something. 前提是该链接实际上可以解决某些问题,但深层链接可以正常工作。 I only get the encoded path if the URL does not resolve at all.
如果URL根本无法解析,我只会得到编码路径。
Update : I suspect in this instance, resolve = responds with a 200 OK
HTTP response. 更新 :我怀疑在这种情况下,resolve =以
200 OK
HTTP响应进行响应。 The URL you linked ( http://veetle.com/v/4d75ad1a6d412 ) gives me a 301
redirect to http://veetle.com/view.php/4d75ad1a6d412 , which in turn gives me a 302
redirect to http://veetle.com/index.php/channel/view#4d75ad1a6d412 . 您链接的URL( http://veetle.com/v/4d75ad1a6d412 )给了我
301
重定向到http://veetle.com/view.php/4d75ad1a6d412 ,反过来又给了我302
重定向到http:// veetle.com/index.php/channel/view#4d75ad1a6d412 。
When I enter the last URL into the Facebook share page, it resolves fine: http://www.facebook.com/share.php?u=http://veetle.com/index.php/channel/view#4d75ad1a6d412 当我在Facebook共享页面中输入最后一个URL时,它可以很好地解析: http : //www.facebook.com/share.php? u= http : //veetle.com/index.php/channel/view#4d75ad1a6d412
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.