为什么80%的码农都做不了架构师?>>>   

// See related links for more status codes
// Use this header instruction to fix 404 headers
// produced by url rewriting...
header('HTTP/1.1 200 OK');
// Page was not found:
header('HTTP/1.1 404 Not Found');
// Access forbidden:
header('HTTP/1.1 403 Forbidden');
// The page moved permanently should be used for
// all redrictions, because search engines know
// what's going on and can easily update their urls.
header('HTTP/1.1 301 Moved Permanently');
// Server error
header('HTTP/1.1 500 Internal Server Error');
// Redirect to a new location:
header('Location: http://www.example.org/');
// Redriect with a delay:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
// you can also use the HTML syntax:
// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By value
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
// content language (en = English)
header('Content-language: en');
// last modified (good for caching)
$time = time() - 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
// header for telling the browser that the content
// did not get changed
header('HTTP/1.1 304 Not Modified');
// set content length (good for caching):
header('Content-Length: 1234');
// Headers for an download:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"'); 
header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');
// Disable caching of the current document:
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
// set content type:
header('Content-Type: text/html; charset=iso-8859-1');
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/plain'); // plain text file
header('Content-Type: image/jpeg'); // JPG picture
header('Content-Type: application/zip'); // ZIP file
header('Content-Type: application/pdf'); // PDF file
header('Content-Type: audio/mpeg'); // Audio MPEG (MP3,...) file
header('Content-Type: application/x-shockwave-flash'); // Flash animation
// show sign in box
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';

转载于:https://my.oschina.net/netljx/blog/17059

Modify HTTP Headers (Examples)相关推荐

  1. Mininet FAQ

    2019独角兽企业重金招聘Python工程师标准>>> FAQ lantz edited this page on 20 Oct · 324 revisions Pages 65 M ...

  2. 使用PHP将HTTP标头设置为UTF-8

    本文翻译自:Set HTTP header to UTF-8 using PHP I have several PHP pages echoing out various things into HT ...

  3. golang中http协议实现

    golang中http协议实现 写了一个爬虫,发现出现了socket泄露的情况.百度了一下发现是缺少了Response.Body.Close(),所以导致连接 没有被正常的关闭.也没有被gc回收.下面 ...

  4. python的from_bytes属性_Python parse.quote_from_bytes方法代碼示例

    本文整理匯總了Python中urllib.parse.quote_from_bytes方法的典型用法代碼示例.如果您正苦於以下問題:Python parse.quote_from_bytes方法的具體 ...

  5. axios 官方指南翻译

    翻译原文链接https://github.com/axios/axios axios 个人读音 :艾克瑟斯 axios Features 特点 Browser Support 浏览器支持 Instal ...

  6. 新必应(new bing)申请

    扩展 获取下面的插件 ModHeader - Modify HTTP headers 添加下面内容 X-Forwarded-For 8.8.8.8 添加完之后搜索 bing.com/new 加入候补 ...

  7. 进不去chatgpt来加入新必应new bing吧,怎么申请newbing,出错了怎么解决

    1.先下载一个edgeDEV版 2.下载好后输入网址:www.bing.com 目前国内用户使用必应有个障碍,微软为中国用户提供了一个中国版"必应",所以此时输入网址会自动跳转到国 ...

  8. openCV的sobel算子的深度学习卷积网络部分的C语言源码

    参考的三种边缘检测算子其一,未完待续..灰度或结构等信息的突变位置是图像的边缘,图像的边缘有幅度和方向属性,沿边缘方向像素变化缓慢,垂直边缘方向像素变化剧烈.因此,边缘上的变化能通过梯度计算出来. 同 ...

  9. 基于aws cloudfront的前端应用灰度方案

    背景 前端应用发布时有测试环境发现不了的一些问题,导致发布经常会出现js或者图片之类的访问不生效问题,故需要引入灰度部署的能力,降低发布风险. 应用是在aws cloudfront上部署的,针对全球加 ...

最新文章

  1. Snagit9-12注册码
  2. 星巴克在GitHub中泄漏API密钥,发现者获4000美金奖励
  3. mysql1040_mysql Error 1040 too many connection解决办法
  4. AQS.transferForSignal
  5. 【.NET Core项目实战-统一认证平台】第十一章 授权篇-密码授权模式
  6. 注意力公式步骤每一步的含义,总共三步
  7. python怎么去重_python列表如何去重
  8. 读书笔记_量化交易如何建立自己的算法交易02
  9. WPF Demo20 模板
  10. PHP array_intersect_assoc()
  11. 计算机信息的应用安全中心在哪,腾讯游戏安全中心
  12. java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId
  13. MacOS上的一些隐藏的快捷小技巧
  14. 42-2017蓝桥杯b java
  15. Linux开机启动一些知识点
  16. UE4 Websocket
  17. 【教程】手把手教你做外卖红包推广返利公众号搭建
  18. 基于中文形近字相似度与加权编辑距离融合实现的汉字纠错算法
  19. 物联卡的测试期、沉默期、计费期你都知道吗
  20. 数据结构:八种数据结构大全

热门文章

  1. wemall微信商城云平台 快速创建您的微信商城
  2. 打开链接跳转浏览器代码
  3. Amazon Web Service 雲端運算平台攻略 【2】
  4. ring0和ring3的区别
  5. 博客系统架构对比分析
  6. 关于大型网站技术演进的思考(二)--存储的瓶颈(2)
  7. Linux: find和xargs用法整理
  8. STM32 SPI NSS 作用
  9. SQL Server2008数据库管理 (第二部分)
  10. 文件的读操作 c# 1614526130