Skip to content

Instantly share code, notes, and snippets.

View jagland's full-sized avatar

Jon Agland jagland

  • Wales
View GitHub Profile
@jagland
jagland / captiveportal.php
Last active September 4, 2015 15:14 — forked from cwd24/captiveportal.php
A captive portal alternative page for pfSense in order to redirect to the redirect url.
<?php
$request_uri = urldecode(str_replace("/index.php?redirurl=", "", $_SERVER["REQUEST_URI"]));
$portal_redirurl = urldecode("$PORTAL_REDIRURL$");
if(!stristr(urldecode("$PORTAL_REDIRURL$"), $request_uri)) {
Header("Location: $PORTAL_REDIRURL$");
exit;
}
?>