hno Posted April 30, 2010 Share Posted April 30, 2010 HI, I want to make a web site that every one can sign up and after that they would have a subdomain of my site name just like web log system .You know blogfa bogging system and when every one makes a new account they have a subdomain of that site. I want to make something like that ,and after every ones registered they would have a subdomain of my site with a script installed it it. How can make something like that? I apologize for my bad english. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/200252-how-to-make-subdomain-by-php/ Share on other sites More sharing options...
robert_gsfame Posted April 30, 2010 Share Posted April 30, 2010 use mod_rewrite, anyway this is Apache issue Quote Link to comment https://forums.phpfreaks.com/topic/200252-how-to-make-subdomain-by-php/#findComment-1050915 Share on other sites More sharing options...
hno Posted April 30, 2010 Author Share Posted April 30, 2010 use mod_rewrite, anyway this is Apache issue can you explain it more ? I didn't understand Quote Link to comment https://forums.phpfreaks.com/topic/200252-how-to-make-subdomain-by-php/#findComment-1050961 Share on other sites More sharing options...
jonsjava Posted April 30, 2010 Share Posted April 30, 2010 mod_rewrite doesn't work for creating sub domains, to my knowledge. sub domains require A or CNAME records, or they don't work. He was almost right. You need a wildcard A record (*.yourdomain.com), then you need to add it to your vhost, then here's an example .htaccess file to get it done: RewriteEngine on RewriteCond %{HTTP_HOST} ^[^.]+\.example\.com$ RewriteRule !^index\.php$ index.php [L] Quote Link to comment https://forums.phpfreaks.com/topic/200252-how-to-make-subdomain-by-php/#findComment-1050963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.