作者xxFrency (阿哲)
看板Web_Design
標題[問題] FB無法正確抓取網頁資訊
時間Sat Jun 18 01:08:17 2016
大家好
小弟最近用CodeIgniter架了個網站
##問題描述如下
FB linter:
https://developers.facebook.com/tools/debug/
這是LINTER,用來看文章被分享時所抓的資訊正不正確
測試的網址:
http://gapure.com/dolly/tw/news/post/8
我都有設定正確的OG屬性(按Ctrl+U可以看)
但就是抓不到
Ctrl+U
http://i.imgur.com/Lj6FF1G.jpg
FB Linter debug後的結果
http://i.imgur.com/SqpBNJ2.jpg
http://i.imgur.com/QDeJxrr.jpg
我猜想會不會跟URL重新導向有關係!?
因為在Linter底下的Scraped URL,一般的正常的網頁是可以Scrape出東西的
但是我的居然是空白
不知道有沒有大師可以解決,感謝不盡
補充
##我的.htaccess設定如下
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
php_flag display_startup_errors on
php_flag display_errors on
##robots.txt
User-agent: *
Allow: /
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.231.239.139
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Web_Design/M.1466183299.A.8F7.html
※ 編輯: xxFrency (36.231.239.139), 06/18/2016 01:09:44
1F:→ Darkland: 用 curl 測試只拿到 301 06/18 09:39
2F:→ Darkland: 你的網站會檢查 cookie ,沒有對應的 cookie 就會設定 06/18 09:47
3F:→ Darkland: cookie 並回應 301 重導到,對於不支援 cookie 的 clien 06/18 09:47
4F:→ Darkland: 就會無限重導,自然也就抓不到資料 06/18 09:48
5F:→ xxFrency: 感謝大大回文,我再試試看! 06/19 10:13