Click to See Complete Forum and Search --> : Running multiple domains off of the same server space...
xvszero
06-11-2009, 12:35 PM
Right now I have two domains pointing to the main index page on the server space I get from webhost4life. What I want to do is have one of the domains point to the main index page, and have the other point to an index page in a folder I create. Essentially running two "separate" sites off of the same server space. Is this possible? Would it have to be done on the server level, or is there any web code that can redirect to a page based on the URL?
svidgen
06-11-2009, 02:56 PM
You can do it either way. Your registrar should provide URL redirection for domains/subdomains. And, your server-side language should also be able to determine the host-name it referenced by, allowing you to send out the Location header if necessary.
Your host should also be able to point the domain at any folder you ask them to. Whether they will is a different story ...
If you have access to the apache (I'm assuming apache) config files, you can see how to set up Virtual Hosts in their documentation (http://httpd.apache.org/docs/1.3/vhosts/name-based.html). Your host is probably using some include file(s) that contain all of the domains on the server using these virtual host directives. It shouldn't take much more than a trained monkey to add a few lines for your particular needs.
... Bear in mind though, the monkey would need to be trained.
Does that help?