开发者

different domains pointing to the same rails app

I'm creating a rails app where users will be able to create and manage multiple blogs from their accounts. The app will be hosted on www.mydomain.com but i want users to specify a domain they own and be able to point it to any of the blogs they've created so that they can have www.usersite.com point to www.mydomain.com/user/:user_id/blog/:blog_id

that way it looks like is being hosted on their site even though is not

i've been reading some post and maybe CNAME is the way to go for this, but i'm pretty new to creating rails apps and if anyone can help me or poi开发者_开发问答nt me in the right direction i would appriciate it.

If you need me to clarify anything please let me know

Thanks in advace danny


As far as I understood your question is more about DNS rather than Rails. I could suggest you Bandcamp as a live example.

There's some tips:

  1. Using CNAME (and I pretty much sure there's no other options) You should provide every user with his own unique subdomain i.e. user.mydomain.com in your case. Quick googling and we find out that there's a solution for Rails 3 — http://bcardarella.com/post/716951242/custom-subdomains-in-rails-3

  2. You should provide them with step-by-step manual how exactly they can modify their domain DNS entries and add CNAME record. It's up to them. You or Your app can't do it. Again, Bandcamp is a great example — http://bandcamp.com/faq_custom_domains

And then you win.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜