Hi, In a ctmagazine from 2007 I found a nice cgi/iptables script to redirect every first visit to a welcome page. When I'm new, my mac is not on the list, and I browse for example to http://www.howtoforge.com I'm redirected to the welcomepage. After visiting the welcome page the mac is added to the allowed list and you can visit the pages on the web. This works except after visiting the welcomepage I can browse every page I want (like ispconfig.org) except the domain I tried to visit when the mac wasn't on the list. I have to close the browser and restart to browse to http://www.howtoforge.com in this example How to fix this?
Code: iptables -t nat -A PREROUTING -p tcp -i $INTERFACE --dport 80 -j REDIRECT --too-ports 80 cgi script Code: #!usr/bin/perl -w use warnings; use strict; use CGI qw/:standard/; my $URL = "http://192.168.0.1/index.html"; my $INTERFACE=eth0; my $remote_ip = $ENV{'REMOTE_ADDR'}; open(LS, "sudo arp - na |"); while(<LS>){ chop if($_ = ~/$remote_ip/) { my @lijst = split(/ /); system("sudo iptables -t nat -I PREROUTING -p tcp -i $INTERFACE -m mac --mac-source $lijst[3] - j ACCEPT"); print "Status: 302 Moved\nLocation: $URL\n\n"; } } close(LS);
I wonder if that has anything to do with your browser's cache. Have you tried to clear the browser cache?
Hi, thanks for your reply. Cleared the cache. Problem still there. Also adding some vars like ?bla=1 to the url doesn't matter. Is there a way to fix this problem?
Browsers tend to cache DNS info as well as images/files/etc. Try creating a new user or new profile for the after check...