"Hosting" user domains?

software development


Okay, bear with me here. I don’t know even enough to know how to ask this.

I have a website that’s based on user directories. In other words, mysite.com//, etc. There are no actual directories though. It’s done with mod-rewrite. It’s really something like mysite.com/item.php?user=joe&dir=joesdirectory1. You get the idea.

Anyway, people are building pages on my site, and I’m wondering if, as a service, I can somehow “host,” (if that’s the right word), domains and subdomains. So if user joe wanted to integrate his homepage on my site with his own website, he could maybe point his subdomain to his user area on my site such that all the pages under mysite.com/joe/ would actually appear to be pages on joespage.com. Does that make sense? Would it be possible? And most importantly, is it something I could automate? (Managing through the control panel wouldn’t be practical, of course.)

I’d be grateful to anyone who could point me in the right direction.


The easiest way to achieve this would be for joe to put up a forwarding script on his own domain/sub-domain. Joe might also have the ability to set up a domain redirect so his domain/sub-domain would point to www.yoursite.com/joe/

The problem I see with this is that the solutions require that joe pay to register and in some cases host his domain, so he might not be interested in using your site anymore. Also, since you are allowed to host unlimited domians and sub-domains it might be that you’d want to actually host their domain/sub-domains for them. This, of course, requires much more advanced scripting.

In this example Joe would go out and register his domain all on his own, and then point the DNS to ns1.(2 and 3)dreamhost.com. Next he goes to your website and uses your script to add the domain into your system. Here’s the complicated part - your script will have to authenciate it self to the panel, and submit the new domain to be added - basically as if you’d filled out the form yourself and hit submit. Upon sucessful completion of that, your script would then modify the mod-rewrite rules to include this new domain.

If you’re interested, the idea of having scripts submitting things to the panel has come up before - though there’s not much informaiton aviable on it. You should be able to search and find the topic - the concept before has been to allow site visitors to set up free E-mail addresses.

Hope this helps.



Thanks for the reply, mattail. Very helpful.

The idea of using a script to access the panel is an interesting one I hadn’t considered. I would prefer to bypass the panel altogether, but this should do the trick.

I’ll try to post back with more info for others if and when I do this.

Thanks again.


Ya, it would be handy to be able to bypass the panel and just use a exec command or soemthing else simple. Unfortunatly becuase of the ‘layout’ of dreamhost hardware/services you have to rely on the panel. The server that hosts your website is completly seperate from the ones that handle your mail, which is seperate from the ones that handle databases. The panel is powered by a culster of computers - which allocate new services to avilable machines… So all such things must be passed through the panel.