php

PHP Header 301

$the_host = $_SERVER[‘HTTP_HOST’];
$request_uri = isset($_SERVER[‘REQUEST_URI’]) ? $_SERVER[‘REQUEST_URI’] : ”;
if($the_host !== ‘zxd.me’){
//echo $_SERVER[‘HTTP_HOST’].$_SERVER[‘PHP_SELF’];
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location: http://m.zxd.me/’ . $_SERVER[‘PHP_SELF’] . $request_uri);
}

Leave a Reply

Your email address will not be published. Required fields are marked *