Rails 应用程序的根提供错误类型的文件
我在 CentOS 服务器上使用 Ruby on Rails 和 apache 2.0。但不知何故,网站的根目录无法加载。它以下载形式出现,具有正确的内容。但它需要以 html 形式作为服务器。网站内的其他链接工作正常(通过向 .htaccess 添加 text/html 类型)。另外,当直接访问杂种时,根确实会出现。或者当我将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
I am using Ruby on Rails on a CentOS-server with apache 2.0. But somehow the root of the website does not load. It comes up as a download, with the right contents. But it needs to be server as html. Other links within the site are working fine (by adding a text/html type to the .htaccess). Also, when accessing the mongrel directly root does come up. Or when i put a index.html in the public folder of the rails app, it gets loaded as well.
My .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 version: 2.3.8
Mongrel version: 1.1.5
Apache version: 2.0.63
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 mongrel_start 中的错误,它无法正常工作。 这解决了问题。希望它将来也能对其他人有所帮助。
Due to a bug in mongrel_start, it wasn't working properly. This fixed the problem. Hope it can be a help for someone else in the future as well.