1) There should be NO output (i.e. echo...
or HTML parts) before the header(...);
command.
2) After header(...);
you must use exit();
3) Remove any white-space(or newline) before and after
?>
tags.
4) Check that php file (and also other .php
files, that are include
d) -
they should have UTF8 without BOM encoding (and not just UTF-8). Because default UTF8 adds invisible character in the start of file (called "BOM"), so you should avoid that !!!!!!!!!!!
5) Use 301 or 302 reference:
header("location: http://example.com", true, 301 ); exit;
6) Turn on error reporting. And tell the error.
7) If none of above helps, use JAVASCRIPT redirection (however, discouraged method), may be the last chance in custom cases...:
echo ""; exit;
No comments:
Post a Comment