I got 2 different centos server(same vers. 6.7) and I have installed apache 2.2.15 for both servers. Problem is I can connect to my website at test1 server but I can't connect to my website at test2 server. Here is wget results for both servers. 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
.
The only difference is that in the first test case, your webserver does a 302 redirect from http://localhost
to http://localhost/login/mainpage
. And from there it returns index.html
.
This is probably something that is set up in your .htaccess
file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.