문제

I am running this website www.miswag.net which is highly dependent on Facbeook. When I share my site on Facebook, I get a "403 Forbidden", here's Facebook's debugger output when I try to scrape my site: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.miswag.net

Please help figure this out.. Thanks

도움이 되었습니까?

해결책

Facebook's scraper doesn't need to read the full page, so they only request part of it by sending a Range header. However, your server seems to be responding incorrectly to that request and returning a 403 error code. You need to check your server and make sure it handles the range header correctly.

To see this in action, try this CURL command:

curl -H "Range: bytes=0-524287" http://www.miswag.net

This is the response I got:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

다른 팁

Compounding on @Waleed'sanswer, if you want to test right away, use Online CURL

  1. fill in www.wiswag.net
  2. ADD OPTION options, choosing --header (-H)
  3. next to it "Range: bytes=0-524287"
  4. CURL button
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top