简体   繁体   English

Apache服务器返回200响应

[英]Apache server returns 200 response

I got 2 different centos server(same vers. 6.7) and I have installed apache 2.2.15 for both servers. 我有2个不同的centos服务器(6.7版相同),并且我为两个服务器都安装了Apache 2.2.15。 Problem is I can connect to my website at test1 server but I can't connect to my website at test2 server. 问题是我可以连接到test1服务器上的网站,但是无法连接到test2服务器上的网站。 Here is wget results for both servers. 这是两个服务器的wget结果。 Is there any idea how to solve this problem? 有什么办法解决这个问题吗?

[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]

It looks like the connection works in both cases. 看起来连接在两种情况下均有效。

In both cases, you end up with a 200 reponse code and the file index.html . 在这两种情况下,您最终都会得到200个响应代码和文件index.html

The only difference is that in the first test case, your webserver does a 302 redirect from http://localhost to http://localhost/login/mainpage . 唯一的区别是,在第一个测试案例中,您的网络服务器执行了302从http://localhost重定向到http://localhost/login/mainpage重定向。 And from there it returns index.html . 然后从那里返回index.html

This is probably something that is set up in your .htaccess file. 这可能是您的.htaccess文件中设置的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM