Apache服务器返回200响应

时间:2015-11-18 12:24:52

标签: php html apache

我有2个不同的centos服务器(相同版本6.7),我已经为两个服务器安装了apache 2.2.15。问题是我可以在test1服务器上连接到我的网站,但我无法连接到test2服务器上的网站。这是两个服务器的wget结果。有什么想法如何解决这个问题?

[root@test1 ~]# wget localhost
--2015-11-18 14:01:45--  http://localhost/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: /login/mainpage/ [following]
--2015-11-18 14:01:45--  http://localhost/login/mainpage/
Reusing existing connection to localhost:80.
HTTP request sent, awaiting response... 200 OK
Length: 7987 (7.8K) [text/html]
Saving to: “index.html”

100%[======================================>] 7,987       --.-K/s   in 0s

2015-11-18 14:01:46 (396 MB/s) - “index.html” saved [7987/7987]



[root@test2 /]# wget localhost
--2015-11-18 14:10:47--  http://localhost/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4 [text/html]
Saving to: “index.html”

100%[======================================>] 4           --.-K/s   in 0s

2015-11-18 14:11:17 (666 KB/s) - “index.html” saved [4/4]

1 个答案:

答案 0 :(得分:0)

看起来连接在两种情况下均有效。

在这两种情况下,您最终都会得到200个响应代码和index.html文件。

唯一的区别是,在第一个测试用例中,您的网络服务器执行从http://localhosthttp://localhost/login/mainpage的302重定向。然后从那里返回index.html

这可能是您在.htaccess文件中设置的内容。

相关问题