Forum Moderators: open

Message Too Old, No Replies

back button friendly redirects?

is it possible with javascript?

         

amznVibe

6:51 am on Oct 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I often make the first (index) page of the website hidden and bounce the visitor to the first sub-section of the site. Then I can turn around and make the first page storage for bot-tracking scripts, extra metadata, etc that is not needed on every single page of the site.

I typically accomplish this using a meta redirect and some javascript to back it up just in case the meta redirect isn't supported by the visitor. Works out nicely because bots ignore both methods. Note that I do *not* want to use a .htaccess redirect because I actually want the index page processed.

The problem is, I know this is unfriendly to human visitors if they made a mistake and want to backup to the search page or whereever they just came from. (right now they just get re-forwarded back to the first subsection over and over when they try to backup)

Can any javascript guru come up with a way to detect the person is just backing up and pop them back one more time in their history? I've been pondering it in my head but I can't come up with a clear set of rules to detect the circumstance.

killroy

8:41 am on Oct 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use .replace() instead of .reload()

But this sounds very much like sneaky redirects and might get you into hot waters some time.

SN

amznVibe

1:56 pm on Oct 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Interesting, window.location.replace('/newpage') seems to work most of the time. It also seems to take a tad longer than a simple window.location='/newpage' giving me a white screen I can actually see for a moment.

But it appears to be a good answer. Is it 100% cross browser? Works in NS4?

Thanks for your help!