Skip to content

Instantly share code, notes, and snippets.

@u0pattern
Created January 10, 2020 17:04
Show Gist options
  • Save u0pattern/6c299642e74dbc4419e0e766f2effe7e to your computer and use it in GitHub Desktop.
Save u0pattern/6c299642e74dbc4419e0e766f2effe7e to your computer and use it in GitHub Desktop.
<?php
# 1337r00t\.me >> u can change it to ur own host (or u can use parse_url($_SERVER['HTTP_REFERER'],PHP_URL_HOST) function instead of regex)
if(!isset($_SERVER['HTTP_REFERER']) || !preg_match('/^(?:http(?:s)?:\/\/)?(?:[^\.]+\.)?1337r00t\.me\/(.*)/',$_SERVER['HTTP_REFERER'])){
exit('<script>window.location.replace("'.htmlspecialchars("https://1337r00t.me/".substr($_SERVER['REQUEST_URI'],1)).'");</script>');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment