开发者

facebook (different?) User-Agents Crawler from like and share?

i am working right now on a website. This whole Website is protected, so only logged in user can access this website (as long as the beta test is running -> limited time).

We have 2 two different types of sharing on our site. One is the simple "Like" button and the other one just uses: http://www.facebook.com/sharer/sharer.php?u={URL}

In order to give access for the facebook Crawler i build this protection:

if(wUserCur::isLoggedIn() || in_array($currentPath, $allowedLogins) || strstr($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit')):
    // do nothing
else:
    wResponse::redirect('/de/register/index.php');
endif;

i know its unsecure but this site isn't meant to be classified.

The big deal 开发者_JS百科here is, that this works for http://www.facebook.com/sharer/sharer.php?u= very well, but if i hit the like button it redirects the crawler to the register page.

Are there different facebookCrawler? Or is there a better possibility?

Thanks for your help.


Both features should use the same user agent The currently deployed crawlers have the user agents

FacebookExternalHit/1.1

or

FacebookExternalHit/1.0

In theory the version number could increment at some point, but currently it's 1.0 or 1.1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜