Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Subdomain, customized home page
July 23, 2008, 10:59 pm
rate this thread
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 www.thesite.com would have a set of information displayed, but
the subdomain (subdomain.thesite.com) 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
When posting example URLs, please don't use existing domains, but
example.com/org instead. They're reserved for that purpose.
Have a look at mod_rewrite. You can use it for internal rewrites like
http://foo.example.com/ => http://example.com/?subdomain=foo
Your script can then easily grab the used subdomain from the $_GET
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.