Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

people can't get out of my web site hitting the "Back" button 2

Status
Not open for further replies.

ffaucher

IS-IT--Management
Jul 31, 2000
102
CA
I recently got a domain name for my web site. So, I added a redirect code to my old URL index.html file. Here it is:

<script language = &quot;Javascript&quot;>
<! --hide from old browsers
var time=null
function move() {window location = 'new URL'}
//
</script>

It works, people are redirected to the new URL but they can no longer use the &quot;Back&quot; button to leave my site. If they try it, they come back to my old URL that send them basc to the new URL. Does somebody know how to correct that?

Thanks in advance,
ffaucher
 
dont think you will get around that one...since the previous page they view directs them forward, your always going to have that in their history. there is a little history list arrow on the back button of most browsers (atleast mozilla and ie, thats what i use, probably others) that you can go back more than one page. thats what i use to get around it. i actually run into this on a lot of sites. maybe someone else has a trick up their sleeve for ya though ;) what we see depends mainly on what we're looking for.
--John Lubbock
 
Try this...

function move()
{
window.location.replace(&quot;new URL&quot;);
}

That should remove the old index file from history. (Unless I've missed something...seems to work for me.)
 
melt7:
thanks for the tip m8! i know i didnt ask the question, but i run into this literally everyday on the web. not that difficult of a prob either. you get a star from me :) what we see depends mainly on what we're looking for.
--John Lubbock
 
Thanks. I actually stumbled across this trying to answer another post on this site. I'm still learning, but this site is certainly helping that along. It's much better than dry textbook questions.
 
melt7

i hear ya. i learn just as much in tek-tips as i do in class...and try to give back when i can. not always right, but i try! :) what we see depends mainly on what we're looking for.
--John Lubbock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top