Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/200252-how-to-make-subdomain-by-php/
Share on other sites

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]

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.