博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
php 页面重定向_如何在PHP中使用HTTP 301重定向页面
阅读量:2524 次
发布时间:2019-05-11

本文共 826 字,大约阅读时间需要 2 分钟。

php 页面重定向

HTTP 301 is an SEO friendly way to redirect readers to a page’s new location. There are a lot of benefits of using HTTP 301 Redirect. These benefits can be found in the . or PHP can be both used for sending 301 redirects. The htaccess method can be found in . This post discusses the method that use php to generate the HTTP 301 Redirect.

HTTP 301 是SEO友好的方法,用于将读者重定向到页面的新位置。 使用HTTP 301重定向有很多好处。 这些好处可以在找到。 或PHP均可用于发送301重定向。 htaccess方法可以在 。 这篇文章讨论了使用php生成HTTP 301重定向的方法。

As an example, we will redirect a page to in PHP.

例如,我们将页面重定向到PHP中的 。

The code:

代码:

Or simpler

或更简单

The header("HTTP/1.1 301") part must be used before the location part, otherwise PHP will automatically set the status code to HTTP/1.1 302 Found.

必须在位置部分之前使用header(“ HTTP / 1.1 301”)部分,否则PHP将自动将状态代码设置为HTTP / 1.1 302 Found。

翻译自:

php 页面重定向

转载地址:http://dmlwd.baihongyu.com/

你可能感兴趣的文章
Mysql 索引优化
查看>>
09湖州二模(自选模块不等式)
查看>>
Mybatis Batch 批量操作
查看>>
Ubuntu server搭建Java web服务器
查看>>
java读取xml配置文件和properties配置文件
查看>>
HDU 4300 Contest 1
查看>>
POJ 3311
查看>>
浅谈模块化
查看>>
14个免费访客行为分析工具
查看>>
(转)arguments.callee移除AS3匿名函数的侦听
查看>>
onNewIntent调用时机
查看>>
MYSQL GTID使用运维介绍(转)
查看>>
高性能HTTP加速器Varnish(概念篇)
查看>>
Linux 如何写makefile文件
查看>>
PHPExcel 使用心得
查看>>
洛谷 P3374 【模板】树状数组 1(单点加,区间和)
查看>>
verilog 代码编写小记
查看>>
PyQT的安装和配置
查看>>
从 docker 到 runC
查看>>
守护进程
查看>>