TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Kent Christiansen wants to hear about how web designers can create redirect
pages that do not stay in the browser history, putting the user in an
endless loop of redirects if they click the back button.
You can for browsers that support JavaScript.
See http://html.about.com/compute/html/library/weekly/aa110199.htm?terms=redirec
t for a script that redirects users to different pages based upon the
browser they're using. The examples on this page use location.href to move
the user to the new page. This method does keep the current page active in
the history, so the user will get back here in the loop you're trying to
avoid.
However, if you use location.replace("http://new.url.com"), it replaces the
current page in the history, and the user won't get back to the redirect
page.
Here's a description of this method, courtesy the HomeSite 4.5 online help:
[replace
This is much like the reload method, except that it loads another document
and replaces the history object entry for the previous URL with the new URL
loaded. Essentially, this prevents the user from returning to the previous
URL, by using the browsers back button. For example, suppose you are at the
URL given above for the examples and the following code gets executed :
self.location.replace('http://www.microsoft.com/')
The browser would navigate to the Microsoft web site and replace the
www.htmlib.com entry in the history object with http://www.microsoft.com
Unless you'd remembered the previous URL, there would be no navigating back
to it. ]