Syntax for that will pass "URL validation"
-
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. -
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. -
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.
-
It wants a full URL, so rather than
blah.html
you needhttp://<portal hostname>:<port>/blah.html
-
@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. -
@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? -
@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 :
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 :
It will show you the lain login page that the captive portal users will see.
You will also see the full URL :
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 :
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.
-
@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. -
@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
-
@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.