You are here: irt.org | FAQ | JavaScript | Link | Q1806 [ previous next ]
Try:
<html>
<head>
<script>
appVer = navigator.appVersion.toLowerCase();
win = (appVer.indexOf('win') !=-1)?1:0;
mac = (appVer.indexOf('mac') !=-1)?1:0;
href = window.location.href.toLowerCase();
macDir = (href.indexOf('/mac') !=-1)
currentPage = href.substring(href.lastIndexOf('/'));
if (win && macDir) window.location = '/windows'+currentPage;
else if (mac && !macDir) window.location = '/mac'+currentPage;
</script>
</head>