【问题标题】:Root of rails application serves wrong kind of filerails 应用程序的根目录提供错误类型的文件
【发布时间】:2010-12-15 18:49:41
【问题描述】:

我在带有 apache 2.0 的 CentOS 服务器上使用 Ruby on Rails。但不知何故,网站的根目录没有加载。它以下载的形式出现,具有正确的内容。但它需要作为html作为服务器。站点内的其他链接工作正常(通过向 .htaccess 添加 text/html 类型)。此外,当直接访问 mongrel 时,root 确实出现了。或者当我将 index.html 放入 rails 应用程序的公共文件夹时,它也会被加载。

我的 .htaccess:

DefaultType text/html # added for the other pages to get them working, like /products
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule .* "http://127.0.0.1:12001%{REQUEST_URI}" [P,QSA,L]

Rails 版本:2.3.8
杂种版本:1.1.5
阿帕奇版本:2.0.63

【问题讨论】:

    标签: ruby-on-rails apache mongrel


    【解决方案1】:

    由于 mongrel_start 中的错误,它无法正常工作。 This 解决了这个问题。希望以后也能对其他人有所帮助。

    【讨论】:

      猜你喜欢
      • 2013-05-24
      • 1970-01-01
      • 1970-01-01
      • 2020-05-15
      • 1970-01-01
      • 1970-01-01
      • 2016-08-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多