Captive Portal url:http://x.x.x.x:8002/index.php?zone to http://wireless.hotspot
-
Hi guys, can you help me on this, I really could not make it happen. I want to change the default captive portal url to a domain name.
Captive Portal url:http://x.x.x.x:8002/index.php?zone change to http://wireless.hotspot when clients want to login. What do I need to do.
Pfsense 2.3
-
Like https://doc.pfsense.org/index.php/Captive_Portal_Pre-authentication_Redirect ?
Still don't get why'd you change it? They'll get redirected to the login page whether they type http://www.google.com or http://wireless.hotspot as long as it resolves in DNS.
-
Hey sir doktornotor, here it goes, when I connected to the hotspot and open any url, it doens't redirect to the login page instead it sends 404 error page.
-
where do you look for this code you are referring?
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;
}
?>
[Rest of CP login page] -
I did a fresh install of pfsense and capgive portal but still redirection to login page does not work.
-
This :
@technobiz:…. still redirection to login page does not work.
as a description of your problem will not help us to find out what you forget to mention (and we should know so we can tell you what is wrong).
Tell us more if not everything about your interfaces.
How you set up DNS.
How you set up the portal (configure page).Start using the default built in login page - and make the portal should work.
You should read : https://en.wikipedia.org/wiki/HTTP_404
Btw : you can not change http://x.x.x.x:8002/index.php?zone to http://wireless.hotspot
This : http://x.x.x.x:8002/index.php?zone is already incorrect. The "zone" parameter should contains value so pfSense knows WHAT captive zone it's handling (more then one can exist)
This : "8002" is hard coded , and the first web server instance that is running to handle your first instance.
When you use something like "http://wireless.hotspot" it implies "http://wireless.hotspot:80" so you will get redirected …. see instruction here https://doc.pfsense.org/index.php/Captive_Portal_Troubleshooting to see what's really going on.