Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1450 If two urls map to the same page, how can I redirect from the old url to the new url without causing a loop?

irt.org | Knowledge Base | JavaScript | Link | Q1450 [ previous next ]

Q1450 If two urls map to the same page, how can I redirect from the old url to the new url without causing a loop?

Say the old url is http://www.old.com/ and the new url is http://www.new.com/ then try:

<script language="JavaScript"><!--
ThisPage = '' + location.href;
if (ThisPage.indexOf('old') !=-1) location.href = 'http://www.new.com';
//--></script>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.