Skip to content

Instantly share code, notes, and snippets.

@cwd24
Created December 19, 2014 16:53
Show Gist options
  • Save cwd24/c5a105654d9f7d811837 to your computer and use it in GitHub Desktop.
Save cwd24/c5a105654d9f7d811837 to your computer and use it in GitHub Desktop.
A captive portal alternative page for pfSense in order to redirect to the redirect url.
<?php
require("globals.inc");
$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;
}
?>
@jagland
Copy link

jagland commented Sep 4, 2015

To get it to work on the Latest version of pfSense (2.2.4) you need to remove line 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment