php如何利用header实现跳转,下面web建站小编给大家详细介绍一下!
浏览器重定跳转
<?php //重定向浏览器 header("Location: https://ipkd.cn"); exit; ?>
浏览器重定跳转
<?php //重定向浏览器 header("Location: https://ipkd.cn"); exit; ?>
404跳转
function getref() { $url = @$_SERVER['HTTP_REFERER']; if( !empty( $url ) ) { if( !strstr($url ,'jb51.net' ) && !strstr($url,'jb51.net')) { @header("http/1.1 404 not found"); @header("status: 404 not found"); include("404.html");//404页面 exit(); } } else { @header("http/1.1 404 not found"); @header("status: 404 not found"); include("404.html");//404页面 exit(); } }
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: https://www.jb51.net' . $_SERVER['PHP_SELF'] . $request_uri); } ?>
上面是“php如何利用header实现跳转”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2865.html
workflows工作流
蘑菇屋,梦幻家园comfyui工作流
汗血宝马ComfyUI工作流
文生图工作流:图片合并comfyui工作流
一个精心制作的微型赛车场ComfyUI工作流
一盒用五颜六色的食材烹制的热气腾腾的寿司
一艘来自工业时代的飞船ComfyUI工作流
树枝上一只色彩斑斓的小鸟
一只由水晶制成的蜂鸟
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!