Forum Moderators: open
Here's a link for Location Header [cs.bu.edu].
And here's one for the JavaScript location.replace() method [webreference.com].
Note: I've read that, at least through version 4, Opera doesn't support relative URLs as arguments for the replace() method. So if you do go this route, it's best to use absolute URLs.
...
<script language="JavaScript">
<!--
location.href='redirect_to.html';
// -->
</script>
...
If you can redirect on the server side, this is far preferable - javascript may be turned off, and you don't want a "Redirecting you to a new page, click here if nothing happens" message.
First: I do agree that a server-side redirect is preferable.
Second: In client-side javascript I use replace() precisely because it changes the browser's history list.
Here's how I currently see the issue -- the viewer expects the BACK button to go the last page they SAW, and if they didn't see the last page in the history list, this becomes problematic. They click on the BACK button, go back to the page with the redirect code and get redirected again, right back to where they started.
The replace() method makes the button work exactly the way the visitor expects it to, and avoids putting them into a loop.
Because replace() does change the history list, stuart probably should not use it on the second move he described -- i.e. to go automatically from the Flash page back to the index page. The visitor has actually viewed the Flash and would expect the Back Button to return there, so the second redirect would use location.href= as you suggest.
But the initial redirect TO the Flash page seems like exactly the kind of situation that the replace() method was developed for.