原始http头末尾的“0”是什么意思(header(“Location:http://www.sitename.com/0”);)

时间:2013-10-12 14:35:38

标签: php http-headers

Web服务器的html文档根目录中的index.php文件包含:

<?php

header("Location: http://www.sitename.com/0");
exit();

?>

...

(请参阅下面的完整列表,但我认为没有做任何事情b / c exit())

文档根目录中没有名为“0”的文件或目录

有谁能告诉我它在做什么/为什么会被使用?

当我在浏览器地址栏中输入http:/www.sitename.com/时,会加载网站并显示地址栏:

www.sitename.com/0

如果我点击按钮,则会加载新页面,地址栏会显示如下内容:

www.sitename.com/0/index.php?toDo=sometext

然后我输入一个不存在的文件名:

www.sitename.com/0/file_not_there.php

它没有抱怨,它只是主页(并留下www.sitename.com/0/file_not_there.php显示在地址栏中)。

您可以提供任何帮助我了解正在发生的事情的帮助。

public_html / index.php的完整列表:

<?php

header("Location: http://www.sitename.com/0");
exit();

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Site Name</title>
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>

<body>
<div align="center">
  <p>&nbsp;</p>
  <p><img src="/somedir/images/logo.png" /></p>
  <p class="style1"><strong>Welcome</strong><br />
 </p>
</div>
</body>
</html>

0 个答案:

没有答案