Subdomain, customized home page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a question about subdomains. I would like my website to have
subdomains that essentially show my regular main website, except that
the subdomain passes as a variable on all pages so that I can use the
subdomain as a variable to customize details. For example, the home
page at would have a set of information displayed, but
the subdomain ( would display certain additional

Am I approaching this correctly? Anyone know the best solution?

(I am currently parsing the url and grabbing the subdomain that way,
but it seems a little...I don't know, iffy.)


Re: Subdomain, customized home page


Quoted text here. Click to load it

When posting example URLs, please don't use existing domains, but instead. They're reserved for that purpose.

Quoted text here. Click to load it

Have a look at mod_rewrite. You can use it for internal rewrites like =>

Your script can then easily grab the used subdomain from the $_GET

Quoted text here. Click to load it

At some point you have to parse it. Either in the .htaccess with
mod_rewrite or in your script. It isn't much of a difference.


Site Timeline