我正在使用IIS7.5作为Web服务器在我的计算机上学习PHP,并且在正确完成301重定向时遇到问题.
教程和论坛都说要使用以下内容:
Header('Location: ' . $url, true, 301);
Run Code Online (Sandbox Code Playgroud)
要么
Header('Location: ' . $url);
Run Code Online (Sandbox Code Playgroud)
在这两种情况下,浏览器(Chrome和Firefox)都显示以下内容,而不是实际重定向:
Object Moved
This document may be found here
Run Code Online (Sandbox Code Playgroud)
使用FireFox Web开发人员工具栏,我检索了页眉,其中包括:
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/5.3.5, ASP.NET
Date: Mon, 21 Mar 2011 18:47:35 GMT
Content-Length: 123
301 Moved Permanently
Run Code Online (Sandbox Code Playgroud)
为什么页面不重定向?显示该页面对于用户来说是多余的并且令人讨厌.
| 归档时间: |
|
| 查看次数: |
10577 次 |
| 最近记录: |