Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

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?

You are here: irt.org | FAQ | JavaScript | Link | Q1450 [ previous next ]

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';

©2018 Martin Webb