php域名转向怎么实现-世界滚动

来源:php中文网 | 2022-11-09 10:07:59 |

php入门到就业线上直播课:进入学习Apipost = Postman + Swagger + Mock + Jmeter 超好用的API调试工具:点击使用

本教程操作环境:windows7系统、PHP8.1版、Dell G3电脑。


(资料图片)

php域名转向怎么实现?

php的2种域名转向写法

第一种

echo "<meta http-equiv="Refresh" content="0;url=" .  $url . "">" ;

第二种

header("Location:".$url);

拓展介绍:

1.http-equiv=http响应头

2.http-equiv和content属性名称/值对,当服务器向浏览器发送文档时,会先发送这些名称/值对

3.<meta http-equiv="名" content="值">

<!--1.禁止浏览器从本地机的缓存中调阅页面内容,设定后一旦离开网页就无法从Cache中再调出 -->     <meta http-equiv="pragma" content="no-cache">   <!--2.清除缓存(再访问这个网站要重新下载!)-->     <meta http-equiv="cache-control" content="no-cache">   <!--3.设定网页的到期时间,一旦网页过期,必须到服务器上重新传输。-->     <meta http-equiv="expires" content="0">      <!--4.关键字,搜索引擎用-->     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">   <!--5.页面描述-->     <meta http-equiv="description" content="This is my page">   <!--6.html+utf-8-->     <meta http-equiv="content-type" content="text/html;charset=utf-8">     <!--7.几秒后页面自动跳转-->   <meta http-equiv="Refresh" content="2;URL=http://www.net.cn/">     <!--8.Set-Cookie如果网页过期,那么存盘的cookie将被删除-->     <meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Wednesday, 20-Jun-200722:33:00 GMT; path=/">

推荐学习:《PHP视频教程》

以上就是php域名转向怎么实现的详细内容,更多请关注php中文网其它相关文章!

关键词: