我们将网站迁移到了VPS服务器(CentOS 5.6 + Plesk 9.5),一切正常,但我在Plesk注意到的一个奇怪的事情是error_log文件,大部分时间里它充满了数百个条目,如:
... [Thu Aug 10 11:35:48 2011] [error] [client xx.xx.xx.xx] File does not exist: /var/www/vhosts/yourdomain.com/httpdocs/category1 [Thu Aug 10 11:35:48 2011] [error] [client xx.xx.xx.xx] File does not exist: /var/www/vhosts/yourdomain.com/httpdocs/category2 ....
如果我打开这些url(ex. http://yourdomain.com/category2)在我的网页浏览器一切正常,没有404错误,头响应200,所以一切正常,我应该看到我想要的页面。 但是为什么日志文件将其视为错误并指出文件不存在? 另外我想提到“category1”,“category2”不是物理目录,它是.htacess和mod_rewritepipe理path,所以不是真正的文件夹。
mod_rewrite似乎没有正确地告诉日志系统,当它看起来像一个文件/文件夹不是物理上存在但由mod_rewrite处理时,请求不应该被视为404。
任何帮助表示赞赏。 谢谢。
蒂姆
尝试使用rewritelog指令来看看发生了什么:
RewriteLog ~/tracefile.rewrite.log RewriteLogLevel 9 RewriteEngine On
(请记住,您必须在激活RewriteEngine(这是逻辑) 之前声明它)。