phptyong 2013-11-25
PHP 301跳转的小代码
代码如下:
<?php
$the_host = $_SERVER['HTTP_HOST'];
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
if($the_host !== 'www.jb51.net')
{
//echo $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
header('HTTP/1.1 301 Moved Permanently');
header('Location: //www.jb51.net' . $_SERVER['PHP_SELF'] . $request_uri);
}
?> server { listen 80; server_name ××××.com; access_log /×××/×××/nginx/log/access.log; error_log /×××/×
if (!$file = fopen($filename, "rb");Header( "Content-type: application/octet-stream ");Header( "Acce