Ruby on rails redmine:下载wiki.html而不是wiki页面

Ruby on rails redmine:下载wiki.html而不是wiki页面,ruby-on-rails,ruby,redmine,Ruby On Rails,Ruby,Redmine,由于我没有在redmine.org的论坛上注册,所以我将问题和我的实际问题复制到这里 我正在Ruby 1.8.7和Rails 3.2.8上运行Redmine 2.1.4。 它由DebianLinux中的Apache2.2.1使用PhusionPassenger 2.2.15提供服务 当我点击一个项目的Wiki时,我得到的是“download Wiki.html”行为,而不是Wiki页面本身 下载的Wiki.html以简单的html格式包含Wiki主页的内容 以下是我的响应标题,其内容配置明显引发

由于我没有在redmine.org的论坛上注册,所以我将问题和我的实际问题复制到这里

我正在Ruby 1.8.7和Rails 3.2.8上运行Redmine 2.1.4。 它由DebianLinux中的Apache2.2.1使用PhusionPassenger 2.2.15提供服务

当我点击一个项目的Wiki时,我得到的是“download Wiki.html”行为,而不是Wiki页面本身

下载的Wiki.html以简单的html格式包含Wiki主页的内容

以下是我的响应标题,其内容配置明显引发了这种行为

HTTP/1.1 200 OK
Date: Tue, 04 Dec 2012 01:17:33 GMT
Server: Apache/2.2
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.15
x-ua-compatible: IE=Edge,chrome=1
content-transfer-encoding: binary
X-Rack-Cache: miss
Content-Disposition: attachment; filename="Wiki.html"
Cache-Control: private
Status: 200
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 535
Keep-Alive: timeout=5, max=500
Connection: Keep-Alive
Content-Type: text/html
这来自Redmine日志:

Started GET "/projects/inventory/wiki.html" for 10.98.107.47 at Tue Dec 04 02:17:33 +0100 2012
Processing by WikiController#show as HTML
  Parameters: {"project_id"=>"inventory"}
  Current user: admin (id=4)
  Rendered wiki/export.html.erb (1.7ms)
  Rendered text template (0.0ms)
Sent data Wiki.html (0.4ms)
Completed 200 OK in 13ms (Views: 0.3ms | ActiveRecord: 3.2ms)

我可以通过在
redmine/public/.htaccess
中注释掉这一行来修复我的安装:

RewriteRule ^([^.]+)$ $1.html [QSA]
该指令是Redmine的重要组成部分吗?还是铁轨?我实际上不知道是谁把所有的配置都放进了.htaccess,也不知道为什么


Redmine似乎工作正常,但有人知道删除此指令是否会在Redmine中的某个地方导致问题吗?

是的,您是对的,这是Redmine的一个错误,出于某种原因,它添加了
内容处置:
标题。我想这是一个关于红矿人的问题。你可能想使用不同的浏览器(Firefox,Chrome)进行检查,因为Redmine可能需要为某些损坏的IE版本做一些事情——这至少会缩小它的范围。我用Firefox 16进行了测试,但IE 8和Chrome 23也出现了同样的情况。这个Apache指令有问题:它说“对于所有URL,使用第一个句点,用
.html
替换后面的所有内容,并附加任何查询字符串。”。因此
/foo/bar.html?status=open
将被重写为
/foo/bar.html?status=open
——没有更改,但
/foo.bar.html
将被重写为
foo.html
(这是错误的),可能这种情况下,
/foo/bar
会被重写为
foo/bar.html
是造成差异的原因。没有迹象表明redmine()需要这样做