a post by Alec, filed in Computer, Websites, how to, html, internet on January 17th, 2008. Read the full post »
PHP redirects are better than Javascript redirects because it is done server side and there is no possibility of the user having JS turned off and not being redirected. The down side is that you need PHP on your server.
It is quite simple:
<?php
header( 'Location: http://www.yoursite.com/new_page.php' ) ;
?>
Just make sure you put it before the doctype and the <html> tag.
a post by Alec, filed in Websites, html, internet on January 17th, 2008. Read the full post »
This is a Javascript Redirect with a delay of 3 seconds
<script type="text/javascript">
<!--
setTimeout('window.location="http://www.google.com"', 3000);
//-->
</script>
This is valid XHTML and you need to put this code in between the <head> and </head> tags of your page. The 3000 means the page will redirect in 3000 milliseconds–or 3 seconds, change it to be what you want.
Do you want an instantaneous redirect? Here’s the code (same rules apply as above):
<script type="text/javascript">
<!--
window.location="http://www.google.com"';
//-->
</script>
The address can be relative or absolute. People may have Javascript turned off, so I find a PHP redirect much better.