Web Hosting Talk







View Full Version : Subdomains on the fly help


Darkneoboi
04-28-2006, 09:58 PM
I want to make subdomains on the fly for a forum hosting site I am making and I don't want it to redirect from subdomain.domain.com to www.domain.com/subdomain (http://www.domain.com/subdomain). Can someone help me out with making a script that lets me do that. If you can help me either e-mail me at neokid90@gmail.com or PM me.

tamasrepus
04-28-2006, 10:26 PM
Could you explain a bit better what you want to do? It did not seem very clear...

If you're asking for free help, be aware that many people on this forum (including me) are only going to give such help if the replies and answers are kept open and available to everyone on the forum. One-on-one support costs time & money, and I'd be the wary of anyone claiming to have a skillset who gives their time & money away for free.

Darkneoboi
04-28-2006, 10:34 PM
Ok. I don't mind on thsi forum then. I am opening a phpbb hosting business with the script that is at http://support.amfrservices.com but it doesn't already use subdomains on the fly and I want to modify it so that it does use them. And that is what I want to do.

Renard Fin
04-28-2006, 11:33 PM
http://www.modwest.com/help/kb7-227.html

It seems there are some nice explanations here. You will of course need to adapt but seems ok to me here altough I havent tried.

axx2k
04-29-2006, 04:43 AM
one way of doing it is to wildcard your subdomain records (so any and all subdomain requests go to the parent domain directory), then use an .htaccess file to point to a .php file which inspects the requested url using the $_SERVER superglobal, strips off the subdomain name using a few str_replace() functions, and performs the appropriate tasks to point to the new url (ie: database query or simple rearrangement of the url). This way you are not using the DNS records to make or maintain subdomains, which will slow down your site as your subdomain count grows.

Hope that helps... :cool:

Darkneoboi
04-29-2006, 08:14 AM
I don't want it to point to a new subdomain. I want it stay stay at the subdomian and appear like the subdomain.

gxshop
04-29-2006, 08:43 AM
I want to know this issue, too,
I ve tried to ask other people , how to make subdomain.domain.com with php script but i dont received any answer. :(
Anyone help me?

axx2k
04-29-2006, 06:14 PM
I don't want it to point to a new subdomain. I want it stay stay at the subdomian and appear like the subdomain.

yeah, thats what using a php script will do for you. instead of creating records, a php script can check the URL string and perform tasks based on the subdomain name... ie: make it look like a subdomain, when its actually not. All you have to do is make a single wildcard record in your DNS. This is where you set an A record named * to point to the root domain. What this does is forces all subdomain requests to go to the root domain path. The php script handles it from there. "it's all in the script, laddy". :)

:cool: