2024 wordpress Link unavailable Could not find a Facebook Page |  Facebook No link Preview Response 418

Facebook No link Preview Response 418

最近因為補給站樂器圓環店音樂成果展的連結分享到facebook上,才發現Link unavailable,只有網站名稱,連縮圖都沒有。
花了好多時間檢查及調整,如robots.txt.htaccess,停用wordpress中的外掛都無效,最後調整網站的SSL憑證解決了這一個問題。




閱讀全文: 2024 wordpress Link unavailable Could not find a Facebook Page |  Facebook No link Preview Response 418

Facebook tool

透過 Facebook Sharing Debugger工具檢查得到了418的回應碼。

Facebook No link Preview Response 418

接下來就是一個很長的時間檢查及調整設定,如robots.txt.htaccess,停用wordpress中的外掛都無效。

SSL憑證檢查

還好在meta for developers No link Preview: Response 418 討論串中看到

Looks like SSL certificate can cause this issue if not installed properly. Missing certificate chain can cause trust issues and crawlers ends up getting 418 code.

If you check here [https://www.sslshopper.com/ssl-checker.html#hostname=https://www.progressive.com/] , it’ll tell you certificate is not trusted in all browsers. While this doesn’t human visitors, FB’s crawlers seem to dislike it.

Please try re installing SSL certificate including CA bundle and see if that helps.

帶來一絲絲的曙光,於是到SSL Checker檢查了moment.tw網站的憑證

https://www.sslshopper.com/ssl-checker.html#hostname=https://moment.tw/

果然憑證中的中間/憑證鏈(Intermediate/chain certificate)有問題

Facebook No link Preview Response 418

最近在SSLS購買憑證一年的時間快到了,需要更新網站的憑證。
檢查憑證內容如下,並沒有包含ca-bundle

(以下因為憑證內容太多所以簡化)

-----BEGIN CERTIFICATE-----
MIIGGTCCBQGgAwIBAgIPc0uPNOKLfH5LOg/QwT3rMA0GCSqGSIb3DQEBCwUAMIGP
.
.
.
Mjw1UIR08fqt91ejidwwr0oDnqD5qR2Ip2VDYWA=
-----END CERTIFICATE-----

ca-bundle的內容

-----BEGIN CERTIFICATE-----
MIIGEzCCA/ugAwIBAgIQfVtRJrR2uhHbdBYLvFMNpzANBgkqhkiG9w0BAQwFADCB
.
.
.
00u/I5sUKUErmgQfky3xxzlIPK1aEn8=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFgTCCBGmgAwIBAgIQOXJEOvkit1HX02wQ3TE1lTANBgkqhkiG9w0BAQwFADB7
.
.
.
vGp4z7h/jnZymQyd/teRCBaho1+V
-----END CERTIFICATE-----

需要將網站的憑證及網站的憑證利用文字編輯器重新組合成一張

順序如下

1.網站的憑證
2.ca-bundle的憑證

新的憑證內容如下

-----BEGIN CERTIFICATE-----
MIIGGTCCBQGgAwIBAgIPc0uPNOKLfH5LOg/QwT3rMA0GCSqGSIb3DQEBCwUAMIGP
.
.
.
Mjw1UIR08fqt91ejidwwr0oDnqD5qR2Ip2VDYWA=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGEzCCA/ugAwIBAgIQfVtRJrR2uhHbdBYLvFMNpzANBgkqhkiG9w0BAQwFADCB
.
.
.
00u/I5sUKUErmgQfky3xxzlIPK1aEn8=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFgTCCBGmgAwIBAgIQOXJEOvkit1HX02wQ3TE1lTANBgkqhkiG9w0BAQwFADB7
.
.
.
vGp4z7h/jnZymQyd/teRCBaho1+V
-----END CERTIFICATE-----

新的憑證一共會有三個

-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----

更新網站的憑證之後,重新啟用apache,再到到SSL Checker檢查了moment.tw網站的憑證,太棒了!這是果然都是綠色的勾勾。

Facebook No link Preview Response 418

Facebook驗證

 回到Facebook Sharing Debugger工具再檢查一次,這次回應碼是206,太開心了縮圖都出來了

Facebook No link Preview Response 418

接著再到facebook去貼文,結果終於正常了(灑花)

Facebook No link Preview Response 418

延伸閱讀

265 Views