Home > Backend Development > PHP Tutorial > apache - 奇怪的现象,PHP网站访问首页一直HTTP 408 错误

apache - 奇怪的现象,PHP网站访问首页一直HTTP 408 错误

WBOY
Release: 2016-06-06 20:39:55
Original
2997 people have browsed it

奇怪现象

1)每次看Apache访问日志,总是很多408错误

网站 .htaccess 配置及顺序

<code>  #非3www重定向在DNSPOD中已设置
  RewriteCond %{HTTP_HOST} ^myhost.cn [NC]
  RewriteRule ^(.*)$ http://www.myhost.cn/$1 [L,R=301]

  #非3www重定向在DNSPOD中已设置
  RewriteCond %{HTTP_HOST} !^(mywww|localhost|192.168.) [NC]
  RewriteCond %{HTTP_HOST} !(my.(cn|loc|test))$ [NC]
  RewriteRule ^(.*)$ http://www.myhost.cn/$1 [L,R=301]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !(xml|html|php)$
  RewriteCond %{REQUEST_URI} !\/$
  RewriteRule ^(.*)$ /$1/ [L,R=301]
</code>
Copy after login
Copy after login

Apache 访问日志

<code>2014-12-23 15:44:46 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:46 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
</code>
Copy after login
Copy after login

奇怪的问题

<code>不知道这些408访问是怎么产生的,没有访问来路也没有请求浏览器信息,就是408,每天都有很多,至少几十个。
</code>
Copy after login
Copy after login

回复内容:

奇怪现象

1)每次看Apache访问日志,总是很多408错误

网站 .htaccess 配置及顺序

<code>  #非3www重定向在DNSPOD中已设置
  RewriteCond %{HTTP_HOST} ^myhost.cn [NC]
  RewriteRule ^(.*)$ http://www.myhost.cn/$1 [L,R=301]

  #非3www重定向在DNSPOD中已设置
  RewriteCond %{HTTP_HOST} !^(mywww|localhost|192.168.) [NC]
  RewriteCond %{HTTP_HOST} !(my.(cn|loc|test))$ [NC]
  RewriteRule ^(.*)$ http://www.myhost.cn/$1 [L,R=301]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !(xml|html|php)$
  RewriteCond %{REQUEST_URI} !\/$
  RewriteRule ^(.*)$ /$1/ [L,R=301]
</code>
Copy after login
Copy after login

Apache 访问日志

<code>2014-12-23 15:44:46 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:46 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
2014-12-23 15:44:51 119.130.186.24 - myhost.cn- - 80 "-" 408 0 0 "from:-"
</code>
Copy after login
Copy after login

奇怪的问题

<code>不知道这些408访问是怎么产生的,没有访问来路也没有请求浏览器信息,就是408,每天都有很多,至少几十个。
</code>
Copy after login
Copy after login

408 Request Timeout

维基百科上都有说的。这个信息表明有人以较慢的速度在向你的服务器发送请求。可能是:

  1. 用户在手动输入数据
  2. 用户的网络慢死了
  3. 用户想通过这种方式进行 DoS 攻击
  4. 用户的程序出错了

后边的「from:-」不知道是什么字段。大概是 UserAgent?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template