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

[eluser]mddd[/eluser]
There are two sides to this story. First, your server has to know what to do when a request comes in for a certain subdomain. For that purpose, you need to set your web server so that it just handles request for all subdomains. That is done in a vhost or similar file like clooner says. You can try if it works: if it is set correctly, a request for somename.yoursite.com should get you just the same result as a request for yoursite.com.

Then, the second step is to check which domain was requested. You can use .htaccess for that. For example:
Code:
RewriteCond %{HTTP_HOST} ^([^.]+)\.yoursite\.com$ [NC]
RewriteRule ^.*$ /site/users/%1 [L]


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