当我试图发送这个表单时,我从所有浏览器中得到这个奇怪的行为。这种形式只有2个字段,标题和文章正文。该表单默认为application/x-www-form-urlencoded。提交时,站点有时会回应一个404.表单提交得到重定向
下面的日志直接从Live HTTP Headers获取。
http://www.faulty-domain.com/article-page POST /article-page HTTP/1.1 Host: www.faulty-domain.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://www.faulty-domain.com/article-page Content-Type: application/x-www-form-urlencoded Content-Length: 3288 blog_title=Article+Title+to+save&newsbody=%3Cp%3EThe+current+blah+blah+blah%3C%2Fp%3E HTTP/1.1 302 Found Date: Tue, 08 Nov 2011 12:42:23 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.14 X-Powered-By: PHP/5.2.14 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: http://www.faulty-domain.com/notFound Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 26 Connection: close Content-Type: text/html
该页面试图发送给自己,然后是假设检查方法是post和各种验证检查,通常的东西。但是,http响应是404未找到的页面。
我们的内部框架像Code Igniter一样工作,所有的请求都会执行index.php。很明显,Web服务器甚至没有尝试执行index.php,但是基于请求标题决定了响应应该是404。发送。我试图逐段添加文章,并查看错误触发的段落。表格提交罚款,直到某一段,在这一点上,我说宾果!我想我隔离了这个问题,并尝试单独使用该段落提交表格,但随后提交了表格。现在让我感到困惑的是,为什么Web服务器会接受它,但如果在原始文章的末尾添加它,它会变得很糟糕!
这可能是一个htaccess的东西,或者一个web服务器的东西,但我无法得到这个东西钉。
更新:
对于所有那些请求查看发送的数据后,继承人的链接。我将在一周左右后删除该文件。 http://www.globalpropertyguide.com/temp/faulty-article.html
下面是可能有所帮助的一部分htaccess。基本上我们的index.php根据$ mod接收的值来决定调用哪个控制器。
RewriteRule ^([^/]+)/$ /$1 [R]
RewriteCond %{QUERY_STRING} !mod= [NC]
RewriteRule ^([^/]+)$ /index.php?mod=$1 [L]
另外,如果有的话它可能会帮助,这是获取登录的Apache的error_log
"POST /write-article HTTP/1.1" 302 26 "http://www.faulty-domain.com/write-article" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24 (.NET CLR 3.5.30729)"
"GET /notFound HTTP/1.1" 404 7635 "http://www.faulty-domain.com/write-article" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24 (.NET CLR 3.5.30729)"
我看到一个302,而不是404 – Phil
@Phil的确,但是如果我们仔细观察Response Header部分,Location就是一个notfound页面。我记下,当服务器决定请求有问题时,它将请求重定向到404。我可能是错的。 – foxlance
.htaccess的外观如何?框架可能是启动重定向的框架吗? “Code Code Igniter”这样的作品并没有太多的可取之处。 – nachito