1

有没有人在 Heroku 上使用带有 multi_site 的 RadiantCMS?我实际上尝试过它并且它轰炸了大时间给出错误:

Heroku | No such app
There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL.

这是我尝试过的:

  1. 转到tractor.heroku.com并使用 admin / radiant 登录。
  2. 如果您看到“站点”部分,您会找到 Foo 和 Bar 站点。
  3. 我编辑了我的 /etc/hosts 文件并将 foo.myapp.com 和 bar.myapp.com 添加到解析为 tractor.heroku.com 的 IP 地址(不完全确定这是否正确)
  4. 现在在浏览器中输入 URL“ http://foo.myapp.com ”,它给了我上面的错误。

是否需要一些特殊配置才能使其在 Heroku 上运行?

4

1 回答 1

1

所以,我终于得到了heroku支持自己的回答。为了大家的利益,把它贴在这里:

接待处说:仅供参考,如果您想要从 appname.heroku.com url 到 yourdomain.tld 的 301 重定向,我已通过以下步骤成功:

  1. freeze radiant(为了能够修改 application_controller.rb;参见http://wiki.github.com/radiant/radiant/running-on-edge

  2. 将此代码添加到 ApplicationController 类中的 application_controller.rb 中:

---->8

before_filter :redirect_domain
def redirect_domain
  if request.host == 'appname.heroku.com'
    redirect_to "http://yourdomain.tld#{request.request_uri}", :status=>301
  end
end

---->8

(非常感谢大卫的支持!)

问候 D

于 2009-12-24T04:53:16.147 回答