Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Allow only one website after authentication page…..

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 2 Posters 995 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      ptrikilis
      last edited by

      Hello im new to pfsense actually is my first install.
      My setup is for captive portal and everything works ok…i use no authentication so after pressing continue to the auth page i get redirected to the url i want....but my problem is that i only want to view the redirected page and not any other page.Is there a way to block all ips expect the ip from the website i use?
      I tryed some rules to the firewall but doesnt seem to work...any help plz

      Thanks

      1 Reply Last reply Reply Quote 0
      • J
        jhochwald
        last edited by

        If I understand you correctly, the "Pre-authentication redirect URL" in the Services/Captive Portal section is what you should look at.
        Your Login page needs to include the following code:

        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;
        }
        ?>
        

        If this is not included, it will not work ;-)

        Cheers

        Regards

        /JH

        1 Reply Last reply Reply Quote 0
        • P
          ptrikilis
          last edited by

          Thanks for the reply

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.