News: This forum is now permanently frozen.
Pages: [1]
Topic: Redirect first http request to custom page?  (Read 1917 times)
« on: April 07, 2009, 09:44:20 »
jjabba *
Posts: 6

I've recently purchased an ALIX 2d3 board to use as a router. My plan is to use one of the eth ports to distribute a free WiFi LAN through a AP running in DHCP redirect mode. This part is already set up.

My Private LAN is running on 192.168.0.* while the Public LAN is using 192.168.50.*.

I want to explain why and how everyone using my free spot is getting their free internet. Thus I would like to capture the FIRST http request from anyone connected to the 192.168.50.* range and redirect it to a custom 'homepage'.

I only want to do this for the first request of a session and I don't want people to have to log in nor to have other traffic blocked or tampered with(If they for instance do not make a http request for a particular session, torrents and other protocols should still work).

Basically, everything should work just like any fully functional WiFi network with the exception of the first http request being redirected to my information page.

Is this possible and how would I go about to set it up?
« Reply #1 on: April 07, 2009, 10:14:05 »
markb ****
Posts: 331

Have a look at the captive portal.
« Reply #2 on: April 07, 2009, 10:43:36 »
YvesDM *
Posts: 11

I think this should work.
Use the Captive portal and change the login page code a bit into something like this (not tested)

Code:
<html>
<head
</head>
<body>
<p> Disclaimer text.... </p>
<form method="post" action="$PORTAL_ACTION$">
   <input name="auth_user" type="hidden" value="username">
   <input name="auth_pass" type="hidden" value="password">
   <input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
   <input name="accept" type="submit" value="Continue">
</form>
</body>
</html>

Add a local user to the captive portal, with username=username and password=password.
Don't forget to disable concurrent logins in the CP settings or everytime a user logs in, the prior user will get logged out.

kind regards
Y.
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines