Skip to content

Instantly share code, notes, and snippets.

@Raztor0
Created December 31, 2018 09:19
Show Gist options
  • Save Raztor0/9573dcac3b76c446db9aa1a07760a0db to your computer and use it in GitHub Desktop.
Save Raztor0/9573dcac3b76c446db9aa1a07760a0db to your computer and use it in GitHub Desktop.
Redirect for Facebook's social preview bot
<?php
$user_agent = $_SERVER["HTTP_USER_AGENT"];
if (strpos($user_agent, "facebookexternalhit") !== false) {
header("Location: https://runescape.com");
} else {
echo("poc.razb.me");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment