Avatar

Facebook crawler (Technics)

by Alfie ⌂, Vienna, Austria, Friday, June 14, 2024, 08:40 (86 days ago) @ Auge

Hi Auge,

Did you see my marked edit in my last posting before you wrote yours?

No.

[…] regexes are not my friends.


Me too, as you know. :-)

In principle it would be possible to search the strings with string functions but in general such a RegEx has to be implemented only once. For tests of regular expressions I always (in fact: every when and then) use regex101.com.

I forgot this goodie, THX! Therefore,

$ua = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/facebook/gmi', $ua)) {
  header('Location: no_fb_page.php');
  die();
}

--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)


Complete thread:

 RSS Feed of thread