我在带有apache 2.0的CentOS服务器上使用Ruby on Rails。但不知何故,网站的根目录无法加载。它是一个下载,具有正确的内容。但它需要服务器作为HTML。网站内的其他链接工作正常(通过向.htaccess添加text / html类型)。此外,当直接访问mongrel时,确实会出现root。或者当我将index.html放在rails app的公共文件夹中时,它也会被加载。
我的.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
Apache版本:2.0.63