I followed instructions given here but the page keeps refreshing. I checked protocol to PAP and also added by host server to walled garden but still the problem persists. What could be the problem? thanks in advance.
Post here
/ip dns ex
/ip hot ex
and your login.html
/ip dns ex
[admin@MikroTik] > /ip dns ex
# jan/02/1970 00:07:27 by RouterOS 6.30.4
# software id = PKV9-J0FC
#
/ip dns
set allow-remote-requests=yes servers=192.168.88.1
/ip dns static
add address=192.168.88.1 name=router ttl=1w
add address=192.168.88.249 name=pmi-pune ttl=1w
/ip hot ex
[admin@MikroTik] > /ip hot ex
# jan/02/1970 00:08:28 by RouterOS 6.30.4
# software id = PKV9-J0FC
#
/ip hotspot profile
set [ find default=yes ] login-by=cookie,https,http-pap
add dns-name=ssipl hotspot-address=192.168.88.1 html-directory=hotspot2 login-by=\
cookie,https,http-pap name=hsprof1
/ip hotspot
add address-pool=default-dhcp disabled=no interface=bridge-local name=hotspot1 \
profile=hsprof1
/ip hotspot user
add name=admin
/ip hotspot walled-garden
add dst-host=192.168.88.185
/ip hotspot walled-garden ip
add action=accept disabled=no dst-host=192.168.88.185
login.html
<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=username&password=password">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
I want all the devices connected to mikrotik to be redirected to a specific URL irrespective of what path they give in browser.
A little misunderstood: redirection is not auto login
If you want to redirect to external server, try this as a login.html:
<html>
<head><title>HTML redirector</title></head>
<body>
$(if chap-id)
<noscript>
<center><b>JavaScript required. Enable JavaScript to continue.</b></center>
</noscript>
$(endif)
<center>
If you are not redirected in a few seconds, click 'continue' below<br>
<form name="redirect" action="http://yourdomain.com" method="post">
<input type="submit" value="continue">
</form>
<script language="JavaScript">
<!--
document.redirect.submit();
//-->
</script></center>
</body>
</html>
Change yourdomain.com, and add it to walledgarden.
You are using internal dns (some sort of proxy dns) probably on MT router. Check in this router if it can resolve names?
Thanks Czolo. But it redirects only when i put ip address in address bar. Is my router not able to resolve the address of url. I want that device’s browser should be redirected to my page as soon as the browser is opened.