Hello,
I am trying to create a blogging application where when users registers different blog is created, so main application is say xyz.com and user T registers then he can browse by typing
T.xyz.com
How can this achieved? Any help would be appreciated
You will require a DNS level API that is capable of adding sub domains. You cannot achieve this redirecting the URL since the DNS name for T.xyz.com will not resolve unless you add the appropriate records in DNS. You will need a CNAME if the subdomain points to the same IP and a 'A record' if the IP address is different for each sub domain.
The discussion thread that you pointed to did not have an answer to the OPs original question. All the people that replied to the thread failed to take into account the fact that a subdomain such as subdomain.domain.com needs a DNS mapping (CNAME or A) in order to redirect the request to the appropriate apache / IIS server in the first place. Without this mapping your web server will not even receive the request.
But i am trying to make project for my college and i am not working in production environment means my site is not hosted, so how to use DNS level api's and how to test it?
You mean to say, only alternative left is to skip this part? let the url show as it is? rather than falling into this complex DNS level api's?
Now you got my point friend! That i what i was asking. I don't want to create any subdomains. Wildcard char * should be sufficient. Now let me refer the link to which you pointed. And this is only conceptual help i required. I didn't know where to post this on this forum. So i posted it in this. You may now move it to any place you want. I will ask more doubts if needed after reading the link. Thanks
And what do you mean by add DNS server? aren't DNS server global? which has mapping for each and every(most of) site's ip address? How can i add my DNS server privately on localhost? and can you name any DNS server that i can install on my machine?
Sorry, but the link to which you pointed, i am not getting anything out it. If i use wildchar *, the request will be caught but how can i then use that request and make it meaninful in my code so as to fetch correct information from database?
If i use url mapping like
nitesh.xyz.com
it should map to
xyz.com?uid=nitesh
I still didn't get how to do that after reading that link