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

    Syntax for that will pass "URL validation"

    Scheduled Pinned Locked Moved Captive Portal
    10 Posts 3 Posters 1.1k 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.
    • T
      trombone
      last edited by

      version 2.5.2
      in past versions after using Captive Portal file manager to upload a file named x.html you could then put captiveportal-x.html in the after authentication Redirection URL box and the user would get redirected to the file x.html.
      Now this doesn't pass the URL validation and allow the captive portal configuration to be saved. The interface Captive Portal is on is 192.168.100.1.
      I have tried http://192.168.100.1/captiveportal-x.html. I don't know enough about the file structure of the OS and the webserver function to get any farther. Does anyone know how to use a locally stored html file as the one to be re-directed to?
      This is related to https://forum.netgate.com/topic/166569/unable-to-save-changes-on-captive-portal-config-page
      but even allowing for the fact that Pfsense shows the wrong input as causing the error I cannot get a locally stored html page to work.
      x.html is not the file name I am using. I have tried many file names.

      1 Reply Last reply Reply Quote 0
      • T
        trombone
        last edited by

        I could never get this to work. I installed 2.5.1 on a different box and restored the backup config from the 2.5.2 box that could not serve up the redirected page. Everything seemed to work on the 2.5.1 box and I went to the remote location and swapped them out earlier today. Everything is working fine so far.
        Anyone wanting to have their redirected to page stored on PFsense locally should not use 2.5.2.

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

          @trombone

          Or wait until https://forum.netgate.com/topic/166569/unable-to-save-changes-on-captive-portal-config-page/2 produces the patch you can apply immediately.

          The redmine issue tracker number is present. https://redmine.pfsense.org/issues/12388

          A solution is proposed, but not yet visible for us.

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

          T 1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            It wants a full URL, so rather than blah.html you need http://<portal hostname>:<port>/blah.html

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            T 1 Reply Last reply Reply Quote 0
            • T
              trombone @Gertjan
              last edited by

              @gertjan
              You are right. I did not intend to reflect poorly on the efforts to fix this. I should have said people needing to do this right now should not use 2.5.2 until it is fixed. Thanks for pointing that out.

              1 Reply Last reply Reply Quote 0
              • T
                trombone @jimp
                last edited by

                @jimp
                Thanks. I will set up a 2.5.2 box again to do this. Can you or anyone tell me how to set or determine the hostname to use in your example? is that the same as the interface name?

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

                  @trombone said in Syntax for that will pass "URL validation":

                  tell me how to set or determine the hostname

                  Ask the pfSense admin what he as put in here :

                  8c181b3b-267d-4567-a6de-244528dafa69-image.png

                  He might be able to tell you what it is.

                  If view can access the captive portal settings page, you could use the blue "Live view" button :

                  c7e801e2-80a6-4fbc-8a9b-ec2e5ec73d78-image.png

                  It will show you the lain login page that the captive portal users will see.

                  You will also see the full URL :

                  7503e4da-c22b-47ee-be35-801eb538086f-image.png

                  This is the part jimp told you about.

                  Note :
                  I'm not using the LAN interface, but a second, dedicated interface.
                  I'm using the https access using acme.sh/Letenscrypt certificates.
                  I use a host override in the Resolver :
                  4c14542d-0540-4f8c-a00a-55ac13679bf5-image.png

                  This is needed, so the this-is-my-portal-interface-host-name.this-is-the-domaine-name.tld resolves to my 192.168.2.1, the IP of the interface of the portal.

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

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    trombone @Gertjan
                    last edited by

                    @gertjan
                    Thanks a lot. I just tried the live view at the branch where I am now. The address at the top is "http://172.31.43.1:8002/?zone=wireless". I am leaving now and will try that this afternoon when I am back here. If that doesn't work I will try the host override in Resolver.

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

                      @trombone
                      Your using http login, not https.
                      So, no certs needed.

                      And you can use an IP, like 172.31.43.1:8002

                      Don't forget to add the port 8002, as browser visits port 80 as a default for http.

                      Strange, your url doesn't include the actual file, /index.php

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

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        trombone @Gertjan
                        last edited by trombone

                        @gertjan Thanks for helping with this.
                        This is my first chance to get back on this. Everything works correctly now. I posted the wrong url- the one I posted was for the captive portal page and not the page that is re-directed to. Your last sentence was the clue I needed.
                        I used the CP page URL for the first part then added "/captiveportal-SH.html" on the end. That works perfectly. It passes the valid URL test and allows saving the config and then it works to redirect to the correct page.

                        For anyone reading this for help. If SH.html is the name of the file, file manager saves it as captiveportal-SH.html.
                        Then use the live view to open the CP page and note the URL. In my case the URL was http:/192.168.100.1:8002 and I added this before the file name.
                        Final result is http://192.168.100.1:8002/captiveportal-SH.html.
                        Thanks also to Jimp.

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