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

    Redirection issue

    Scheduled Pinned Locked Moved Captive Portal
    6 Posts 4 Posters 1.5k 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.
    • D
      defender110
      last edited by

      Hi everyone!
      I set up the captive portal in the latest pfSense (2.4.5) and I could swear the redirection after acceptance of the rules (no authentication) was working earlier (2.4.4).
      Now Windows clients get redirected to msn.com, other clients to other pages. DNS is pointed to OpenDNS, but that was always like that.
      Any idea why it does not redirect to the set page https://www.interpressnews.ge/en/ , but to msn instead?
      Also tested with a Xiaomi phone, which just shows upon connection a white page saying “You are connected”.
      Any ideas of whats going on? What could be the problem?
      To illustrate the issue, I made a short video.
      In a pfSense group on Facebook, another user confirmed having the same issue lately.
      Thank you!

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

        Hi,

        2.4.5, compared to 2.4.4-p3 doesn't includes much news, but ...

        Look here https://github.com/pfsense/pfsense/commits/RELENG_2_4_5/src/usr/local/captiveportal/index.php - the second commit from the top : "Only redirects the user to the default page if no specific page..…"
        Which means to me : user will get redirected to the URL if one was present on the initial browser request.

        This commit has been applied :
        https://github.com/pfsense/pfsense/blob/b4ce86dc6d8c85b5afd462420d5eeee5397c0fe8/src/usr/local/captiveportal/index.php#L96

        which basicly tests if a redirurl parameter is present in the browser's request URL . And if so, your redirected to there.

        Or, the description of "After authentication Redirection URL" is

        Set a forced redirection URL. Clients will be redirected to this URL instead of the one they initially tried to access after they've authenticated.
        

        At a first glance, this looks not good / conflictual.

        I use the old way :

        if (!empty($cpcfg['redirurl'])) {
        	$redirurl = $cpcfg['redirurl'];
        } elseif (preg_match("/redirurl=(.*)/", $orig_request, $matches)) {
        	$redirurl = urldecode($matches[1]);
        } elseif ($_REQUEST['redirurl']) {
        	$redirurl = $_REQUEST['redirurl'];
        }
        

        $cpcfg['redirurl'] is the ""After authentication Redirection URL" setting.
        If one exists, the user is redirected there.

        I'll look into this after the weekend.

        Btw : thanks for the URL you used for the Blocked MAC settings 👍 .

        @defender110 said in Redirection issue:

        hite page saying “You are connected”.

        This happens when you visit the captive portal again,, after 'login' using a direct URL like
        http://192.168.2.1:8002/index.php?zone=yourzone

        Something else : you are aware of the “You are connected” that exists since 2.4.4-p1 - and isn't resolved yet in 2.4.5 ?
        basicly, when you edit portal settings while users are connected, they stay in the "connected user database" but their firewall rules are wiped.
        Simple solution : do not edit portal settings while users are connected. And if you have to, disconnect all users from the portal.
        Other solution : there is a patch that resolves this issue - I'm using it for the last 6 months now.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • S
          stompro
          last edited by

          Hello, I'm running into the same issue, my after auth URL is no longer being used when I test on 2.4.5.

          We used this to redirect to a specific page per firewall to record wireless usage stats, but now we are not getting any stats.

          Josh

          Hardware used: Alix 2D13 X 10, APU2D4 X 10, SG-2200 X 10, SG-2440 X 4

          1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan
            last edited by

            Look at the other very recent thread in this forum (captive portal) about the issue, and a 'solution'.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            V 1 Reply Last reply Reply Quote 0
            • V
              valentinius @Gertjan
              last edited by

              @Gertjan can you provide me with the link to this? Thanks in advance!

              1 Reply Last reply Reply Quote 0
              • GertjanG
                Gertjan
                last edited by

                No ;)

                An image : the other Redirection issue - 2 inch lower :

                8d72916b-452d-482b-8c5c-086bfa63a5b8-image.png

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

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