diff --git a/header.php b/header.php index fa0c25e..3acc0c7 100644 --- a/header.php +++ b/header.php @@ -6,6 +6,13 @@ $requestUri = $_SERVER['REQUEST_URI']; $queryString = $_SERVER['QUERY_STRING']; +if ($httpHost === 'nodebeginner.org') { + $location = 'http://www.nodebeginner.org'.$requestUri; + header('HTTP/1.1 301 Moved Permanently'); + header('Location: '.$location); + die(); +} + if (substr($requestUri, 0, 11) === '/index.html') { $location = 'http://'.$httpHost.'/'; if ($queryString !== '') {