1、创建PHP文档,明确重定向之后的URI
2、使用header()函数创建302重定向,示例:<?phpheader("Location:$redirect");exit;
3、保存内容,在浏览器捕获跳转
4、使用header()函数创建301重定向,示例:header('HTTP/1.1 301 Moved Permanently');header(&鳎溻趄酃quot;Location: {$redirect}");
5、保存内容,捕获301重定向
时间:2024-10-12 19:14:01
1、创建PHP文档,明确重定向之后的URI
2、使用header()函数创建302重定向,示例:<?phpheader("Location:$redirect");exit;
3、保存内容,在浏览器捕获跳转
4、使用header()函数创建301重定向,示例:header('HTTP/1.1 301 Moved Permanently');header(&鳎溻趄酃quot;Location: {$redirect}");
5、保存内容,捕获301重定向