SubDomain Queries


I have a requirement in my rails application where i need to provide access to a blog from another domain.
e.g: should point to my app’s blog_controller’s show action. Is this possible.

& if it is possible, will the user see:


I read a lot about Subdomain_fu. But i think it can only emulate subdomains in my own app. like ( or (

I really need help on this. Any pointers or suggestions are always welcome.


Hi Sahil,

If someone types in, you will need access to the
server on which that domain resides in order to redirect it to your
app, it has nothing to do with how you structure your application.

If you setup a redirect, then the user will see
unless you reconfigure the routes in routes.rb. The alternative so
that the user sees is to frame your site on the website although this is considered slightly 2001 and not
really the done thing.


Apache and mod_rewrite will be your friend. I would also setup a
virtualhost for the

But are you saying that you have which is a rails app
and you want your to use your blog controller?

Or when people go on your blog they should see in
the browser?

No, actually i am not looking for the redirection thing. What i want
is the CNAME Record change of I have access to this
and the other domain.
so, when a user goes to, he should see contents of
the the rails_app, but the domain part of the url should not change.



? So, maybe I'm not understanding the issue.

Create a virtual host for and install your blog app
there. No redirection, no url change.


Yes, i think you are right.