Community discussions

MikroTik App
 
1littlewisp
newbie
Topic Author
Posts: 36
Joined: Wed Jun 10, 2009 6:23 pm

[SOLVED] Hotspot HTML Redirect

Mon Jun 13, 2011 11:28 pm

I'm trying to set up a MT hotspot for the sole purpose of redirecting new users to a web page the first time they connect to the network. The only things I have changed from the default Hotspot setup are:

1. Changed authentication from CHAP to PAP

2. Added a username "admin" with the password "temp123"

3. Changed html for login.html to:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=admin&password=temp123">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
4. Deleted alogin.html

5. Changed html for redirect.html to:
<html>
<center>
<head>
<meta http-equiv="Refresh" content="3;url=http://www.example.com" />
</head>

<body>
<h1>Welcome to Example, Inc.</h1>
<h2>Please wait while you are being redirected.</h2>
<p>&nbsp;</p>
<p>If nothing happens within 5 seconds, please click <a href="http://www.example.com">here.</p>
</body>
</center>
</html>
This works perfectly for one host. The second one that tries to login just seems to be stuck in a loop at login.html. Can anybody tell me what would cause this?
Last edited by 1littlewisp on Tue Jun 14, 2011 12:56 am, edited 1 time in total.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Hotspot HTML Redirect

Mon Jun 13, 2011 11:37 pm

The problem isn't with anything you're showing here.

The username admin under "/ip hotspot user" is pointing to some profile that is configured under "/ip hotspot user profile", the user refers to the profile by name. That profile has its shared-users property set to 1. The first user logs in, that works OK, a second user logs in, and is refused because the profile says only one concurrent user may use it. The user gets redirected back to login.html after a failed login, and it keeps looping in that fashion.
Set the shared-users property to unlimited (in Winbox just collapse the field to do that) and things should start working.

You can easily troubleshoot issues like this by adding an item under "/system logging" and logging the "hotspot" topic to echo or memory. In this case the router would have told you that it refused login for the "admin" account because of profile limitations. This generates a lot of info so only leave it turned on during troubleshooting.
 
1littlewisp
newbie
Topic Author
Posts: 36
Joined: Wed Jun 10, 2009 6:23 pm

Re: Hotspot HTML Redirect

Tue Jun 14, 2011 12:55 am

After hours of troubleshooting, I just discovered independently of this thread what was going on. Yes, it was shared users. :facepalm: Thanks for wasting your time reading/replying to this!