Skip to content

301 Redirect [PHP]

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/new-url/");

Done. PHP 301 redirect is now rolling in given directory once you put that, say, in a file named index.php.