php

PHP header redirect

PHP header redirect Redirect users to another page or site using header: Location

At times, you may find yourself moving pages around or even changing domain names. Using the header function of PHP we can direct visitors (and search engines for that matter) to the new location with 3 lines of code.

<?php
header ('HTTP/1.1 301 Moved Permanently');
header ('Location: http://www.example.com/newpage.php');
exit;
?>

Syndicate content