Code Snippets → PHP → PHP Redirect PHP Redirect Chris Coyier on Sep 29, 2009 <?php header( 'Location: http://www.yoursite.com/new_page.html' ) ; ?>
It’s important to remember that this has to be the first output in the document for it to work. For examples, see the PHP Manual.
You should use
Wat about testin from a local server.
A simpler yet adjustable php function to redirect.
Don forget that the header function should be the first thing typed in, or you will have to turn on output buffering in your ini file or call this function, ob_start()
quick and dirty redirect (also if headers allready sent)
just call forceRedirect(‘http://www.domain.dd’);
And use “UTF-8 without BOM” instead of “UTF-8” as your document encoding. Otherwise some “unnecessary” bytes will be send before PHP-interpreter will meet “” construction.
how about redirect all the links in one page …
some give me a script ,plzz
This is the function that I’ve got in my library
Thanks for sharing. Would like to share that we need to make sure there is no output sent before calling header function. Else it won’t work as expected.