0
我在服務器上託管了三個網站(example1.com,example2.com,example3.com)。有一個頁面(test.php的)上example1.com只用裏面的代碼如下:標題位置重定向中的奇怪問題
<?php
header('Location:http://example2.com/a.php');
?>
當我瀏覽的test.php它去http://example1.com/a.php。它不明白它是另一個域名的url,它試圖找到自己的頁面。
但是當我把http://google.com而不是example2.com/a.php它工作正確。我真的很困惑。
什麼問題?我應該在服務器上設置一些配置嗎?
(我是託管服務器的管理員)。 Ps。服務器位於磅服務器後面。
編輯:
下面是example1.com/test.php
Response Headers:
HTTP/1.1 302 Found
Date: Tue, 09 Oct 2012 09:03:34 GMT
Server: Apache/2.2.16 (Debian)
Location: http://example1.com/a.php
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 21
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Request Headers:
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection keep-alive
Cookie mycookie
Host example1.com
User-Agent Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1
你可以發佈你在a.php中有什麼example2.com? –
有一個簡單的回聲'嗨';命令在裏面。 –
如果您將http://example2.com/a.php放入瀏覽器,它是否正常工作? – Pigueiras