and if you want to be able to output html before the redirect, since you cant do that with header, and header will just show a blank page before the redirect you use
<meta http-equiv="Refresh" content="5;http://www.url.com">
put that in your head tag, after the page has been loaded for 5 seconds it redirects.