A quick way to make redirects permanent or temporary is to make use of the $http_response_code parameter in header().
<?php
header("Location: /foo.php",TRUE,301);
header("Location: /foo.php",TRUE,302);
header("Location: /foo.php");
header("Location: /foo.php",TRUE,303);
header("Location: /foo.php",TRUE,307);
?>
The HTTP status code changes the way browsers and robots handle redirects, so if you are using header(Location:) it's a good idea to set the status code at the same time. Browsers typically re-request a 307 page every time, cache a 302 page for the session, and cache a 301 page for longer, or even indefinitely. Search engines typically transfer "page rank" to the new location for 301 redirects, but not for 302, 303 or 307. If the status code is not specified, header('Location:') defaults to 302.