這是我希望用戶能夠共享的網址: http://dealsfortherich.com/product/6379316如何阻止facebook sharer.php忽略來自目標網址的數字?
所以我的應用程序(PHP)構造此URL:
https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdealsfortherich.com%2Fproduct%2F6379316
如果你看看這個鏈接,你會看到產品編號已被截斷。 Sharer.php是忽略了斜槓(%2F)後的數字 如果我讓這個數字字母數,它的工作原理:
https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdealsfortherich.com%2Fproduct%2F6379316X
或 https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdealsfortherich.com%2Fproduct%2FX6379316 或 https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdealsfortherich.com%2Fproduct%2F637X9316
添加尾部的斜線沒有幫助: https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdealsfortherich.com%2Fproduct%2F6379316%2F
很明顯,我可以在我的應用程序中寫一個條件給han這樣的網址: http://dealsfortherich.com/product/6379316X 但是,就搜索引擎而言,我已經複製了內容。
我應該放棄而不使用sharer.php嗎?
順便說一句,我使用PHP來生成這個鏈接服務器端,而不是使用https://developers.facebook.com/docs/reference/plugins/like/,因爲用戶的瀏覽器建立約20個這些按鈕javascript會導致巨大的響應問題(滯後)。 – daSong
如何處理斜線和頁面? '/ index.htm' – arttronics
謝謝,這是一個很好的嘗試...但我的應用程序沒有很好地迴應:http://dealsfortherich.com/product/6379316/index。htm – daSong