Quick tip...
Code:
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.somewhere.com/somepage.html');
?>
This is the full file -- no extra code (HTML, BODY, etc).
Save it as
index.php if you're redirecting a folder or site.
Or some other PHP file that you're using as a redirect, i.e. theoldpage.php
Note: You don't have to redirect to a file -- it can be a folder or domain, too.
Examples:
Code:
header('Location: http://www.somewhere.com/');
header('Location: http://www.somewhere.com/folder/');
Trivia: You can also run HTML as PHP, to recycle an old HTML name and not rely on META redirects.
When the server is set to run HTML as PHP, simply save the code into a new HTML file -- i.e, index.html or index.htm
The better solution is to use .htaccess when available.