Forum Moderators: phranque
I apologize if this answer is already out there, however I need a relatively quick solution.
Assuming I have a domain mysite.com with a docroot of /www/htmldocs, when a new user account is created, I want the user to access the site using their username as part of the URL:
users.thisisshade.mysite.com
which still resolves to the original document root. I thought about using the approach outlined in:
[tips-scripts.com...] (and/or)
[tips-scripts.com...]
but since all the subdomains resolve to the document root, creating hundreds of subdirectories just for the sake of a subdomain doesn't seem like a good use of space. Then I thought about having a script dynamically add <VirtualHost> records to an .htaccess file:
<VirtualHost *:80>
ServerName users.thisisshade.mysite.com
ServerAlias www.users.thisisshade.mysite.com
DocumentRoot /www/htmldocs
</VirtualHost>
But this requires a restart of the server, right?
Thanks in advance for your assistance, everyone.
Respectfully, Shade
I presume you'll be using a script to manage the users' access and give meaning to the concept of "individual user space"? If so, then what's needed is just an internal rewrite of the subdomain into a query string name/value pair to be passed to your script (using mod_rewrite).
Please post your best effort at coding this for further discussion. You may wish to try a search for (numerous) previous threads on the subject of passing subdomains to a script, and please take a look at our forum charter [webmasterworld.com] as well.
Thanks,
Jim