caruizdiaz
caruizdiaz

Reputation: 163

Browser's Redirection

I'm writing an internet access tool for a LAN that uses Linux + iptables to redirect to a login page everytime a user tries to access to any web page. That login page asks for user and password and if the authentication was successful, it removes the iptables rule so the subsequent requests goes to the originally intended webpage.

This is the situation:

  1. If I go to http://www.abc.com, my default gw redirects me to 10.0.10.10/login.php
  2. I successfully login.
  3. If I try to go again to http://www.abc.com, the browser is automatically sending me back to 10.0.10.10, it's like some sort of caching.
  4. If I try to enter to another page other than abc.com, it works as expected.

How can I tell the browser to remove the "remembered" rule of redirection?

Upvotes: 0

Views: 148

Answers (3)

nano.net.tr
nano.net.tr

Reputation: 47

Based on the http://www.w3schools.com/tags/att_meta_http_equiv.asp

If you use these meta tags page wont be cached neither by a browser nor a proxy server:

<meta http-equiv=”expires” content="Wed, 22 Jul 1981 16:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="cache-control" content="no-cache" />

Upvotes: 3

Patriks
Patriks

Reputation: 1012

You can remove that page/url from browser history using javascript that will do the thing you need. and also when user clicks back button on browser he will not get back to the previous page where he/she was log in.

Upvotes: 0

Mihai Iorga
Mihai Iorga

Reputation: 39704

You need to Hard Refresh cache.

Usually you can do that with CTRL+F5 or CTRL+R

or you change your rule to make the second redirection to same page but with some # fragment identifier

eg: if user enters abc.com and gets redirected on login if he tries to go again to abc.com and you see that he was logged in redirect him to abc.com#1

Upvotes: 1

Related Questions