[英]Apache server returns 200 response
我有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]
看起來連接在兩種情況下均有效。
在這兩種情況下,您最終都會得到200個響應代碼和文件index.html
。
唯一的區別是,在第一個測試案例中,您的網絡服務器執行了302從http://localhost
重定向到http://localhost/login/mainpage
重定向。 然后從那里返回index.html
。
這可能是您的.htaccess
文件中設置的內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.