404

header ("HTTP/1.1 404 Not Found");

301

header ("HTTP/1.1 301 Moved Permanently"); 
header ("Location:http://www.baidu.com");

允许跨域

header('Access-Control-Allow-Origin:*');

下载文件1

header("Content-type: application/x-gzip");
header("Content-Disposition: attachment; filename=文件名");header("Content-Description: PHP3 Generated Data");

下载文件2

header ('Content-type: application/file');
header ("Content-Disposition: attachment; filename='test.file'");
readfile ("test.file");

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注