Permanent (301) Redirect via PHP

Permanent (301) Redirect via PHP

To permanently redirect a page via PHP, place this code before all other content (i.e., at the very top of the document):

<?php // Permanent 301 Redirect via PHP
	header("HTTP/1.1 301 Moved Permanently");
	header("Location: http://domain.tld/new/location/");
	exit();
?>

Article ID: 154, Created On: 4/11/2016, Modified: 4/11/2016

Feedback (0)