Forum Moderators: open
I want to redirect old product pages. In the Head of the old page, I am using <SCRIPT SRC="/JS/2001.js"></SCRIPT> to point to the external javascript.
The external "/JS/2001.js" is simply window.location.replace("http://www.mydomain.com/newpage.html");
The redirection works perfectly but the Back Button on the newpage.html loops the user. I have tried <INPUT TYPE="button" VALUE="Go Back" ONCLICK="history.back(3)" NAME="button"> and <a href="javascript:history.back(2 and 3)">back</a>, but the loop continues.
I can't imagine disabling someone's Back Button.
Thanks.
By the way, the safest way to create a link to an external js file is:
<script type="text/javascript" language="JavaScript" src="file.js"></script>
What you have is a bit too barebones to be sure of it working on all browsers.
Many of my old product pages do well for some useful kw searches and I would hate to lose this traffic as I present a new line. Please check my thinking here: With this method, I can keep the "old" pages up for their keyword value, yet still direct the searcher to my new product line in a seamless, fair and safe way. I htaccess-protect my JS folder and I have not performed any trickery on the searcher nor flagged myself to the SEs.
And this, the scripting I described earlier plus your kind response, is the easiest and safest of redirection methods. Correct?
For now. As far as I know.
It is, after all, a way of feeding a spider something different from what the average user will see, and that is Google kindly calls Search Engine Persuasion (SEP) or more unkindly, SPAM. But for now, search engines won't risk automatically running everyone's JavaScript just to check, so this is a relatively safe redirect method.
However, if someone complains, you don't really have much of a defense against human review, except to say that visitors with no javascript can still see the original page. Keeping that back button working is a big step toward avoiding the complaints.