0

I am using a hyperlink

<a href="index2.htm">Redirect</a>

If I click Redirect hyperlink, it is redirecting to index2.htm file. If I go back (especially back button which I gave in index2.htm) to the previous page (index.htm), it is not reloading in firefox. It is working fine in IE..I need to force reload the index.htm file in firefox..

Is it possible>

2 Answers 2

1

If you want the original page (the page containing the redirect link) to be refreshed (that is, not cached) you can use a few meta headers:

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

If you want the original page to automatically redirect to index2, try inserting the following at the beginning of your <body>: <script type="text/javascript">window.location.href="index2.html";</script>

But that's an ugly way to do it. I suggest looking up 503 redirects for a properly-done (nice to SEO) way.

Sign up to request clarification or add additional context in comments.

Comments

1

Try this :

window.location.href = document.referrer;

Fiddle example :

http://jsfiddle.net/9HU86/3/

3 Comments

Already I am having different class for the button..what shall i do?
You should also be able to just use window.location.reload()
i've update my Fiddle example by using an ID and not a class. Just take it, add your class and enjoy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.