Welcome Guest, Not a member yet? Register   Sign In
Add a dynamic sub-domain for every user
#4

[eluser]WanWizard[/eluser]
Not always.

If you have a limited about of (static) subdomains, that's the way to go. If your subdomains are dynamic, vhosts won't help you. You don't want to modify the config and restart Apache everytime a website admin creates a new user.

There are two options:
Use mod_vhost_alias, which is what ISP's use for mass vhosting. This allows you to dynamically link a subdomain to a disk location. You still have to make sure all subdomains end up at the same code, so you might want to create symlinked directories when a new user is created in the application.
You can also forget about vhosts, and use a dedicated IP for your application.

Make sure DNS points to that IP so all requests arrive at your application. To make that dynamic as well, use DNS wildcards. That means you have to use <user>.example.org, not www.<user>.example.org, as wildcards have to be at the left, and on their own.

In both cases you can either use mod_rewrite or PHP code to deal with all the different hostnames arriving at your application.


Messages In This Thread
Add a dynamic sub-domain for every user - by El Forum - 06-10-2010, 10:06 PM
Add a dynamic sub-domain for every user - by El Forum - 06-11-2010, 12:44 AM
Add a dynamic sub-domain for every user - by El Forum - 06-11-2010, 01:06 AM
Add a dynamic sub-domain for every user - by El Forum - 06-11-2010, 01:12 AM
Add a dynamic sub-domain for every user - by El Forum - 06-11-2010, 01:13 AM
Add a dynamic sub-domain for every user - by El Forum - 06-11-2010, 01:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB