Can I redirect my first domain to a subdirectory of public_html?
This is a wiki article created by HostingRails users. Please login or signup to make edits.
Hi everyone,
I'm trying to figure out the best way to organise my domains at Hosting Rails. Here's what I would like:
My first domain (domain1.com) to point to the directory `~/public_html/domain1`.
My second, add-on domain (domain2.com) to point to the directory `~/public_html/domain2`.
Further, domain1.com is a rails app, so I'd actually have `~/public_html/domain1` as a symlink to `~/domain1app/public`. The domain2.com site just a a simple index.html page I want to serve up from `public_html/domain2/index.html`.
The advice I've read from other forum threads is that I should just leave domain1.com pointing to `~/public_html` (which is actually a symlink to `~/domain1app/public`) and stick my domain2 directory in `~/public_html` (which will actually place it in `~/domain1app/public`).
However, I'd rather not put unrelated directories or symlinks in my `~/domain1app/public` folder as it has implications if I'm using SVN. Even worse, if I decide to take down or move my domain1app then I will lose all of my other add-on domains unless I explicitly move them out of `~/domain1app/public` and into a new `~/public_html`.
Wouldn't it be better to have a separate directory for each domain that I can manage independently?
-------
Hi Mark, please ask this question in the deployment troubleshooting thread. Essentially you can setup all your domains in folders in your root and just work the symlinks accordingly. Please read the 'how to deploy multiple Rails apps..' tutorial and the link that is at the top of that...it should help you get your head around this. Cheers, ~William
Mark
William