Redirect to a different webpage

From CodeCodex

MediaWiki[edit]

#redirect [[New page name]]

JavaScript only[edit]

This changes the current URL.

window.location="http://codecodex.com";

JavaScript in HTML[edit]

Simple redirection[edit]

This changes the URL as soon as the page is loaded.

<SCRIPT language="JavaScript">
<!--
window.location="http://codecodex.com";
//-->
</SCRIPT>

Redirection based on browser type[edit]

This changes the URL as soon as the page is loaded to a browser specific page.

<SCRIPT language="JavaScript">
<!--
var browserName=navigator.appName; 
if (browserName=="Netscape")
{ 
window.location="http://www.codecodex.com/ns.html";
}
else 
{ 
 if (browserName=="Microsoft Internet Explorer")
 {
  window.location="http://www.codecodex.com/ie.html";
 }
 else
  {
   window.location="http://www.codecodex.com/other.html";
   }
}
//-->
</SCRIPT>

PHP[edit]

<?php
$URL="http://www.example.com";
header ("Location: $URL");
?>