I need to create sub domains on the fly, and i need to show the content depending upon the sub domain.

For example:
i need to convert the url like
www.mydrupal.com/q=cricket to cricket.mydrupal.com,
and both urls should display extactly the same content coming only from one database.

The idea of creating different sub folders within the sites/default is not acceptable as i don't know, like the above example how many sub domains in need to create depending upon the taxonomy

Comments

sin’s picture

It is more Apache config question then Drupal performance issue.
Apache supports wildcards in virtual hosts and I've heared some hosters allow to add "*.mydomain.com" domains. All third level domains will be directed to a single Drupal installation directory in which you may use mod_rewrite to move third domain to a query parameter, after that you can check this parameter against your taxonomy, serve content or 404. I never done that myself.

nikhilsukul’s picture

Thanks for the reply, actually i added the following in Apache:

DocumentRoot "/drupal"
ServerAlias *.mydrupallocal.com
ServerName www.mydrupallocal.com ........

but , if i type anything.mydrupallocal.com, it just shows page cannot be found!!!

terotil’s picture

And you have anything.mydrupallocal.com defined in nameserver and 'host anything.mydrupallocal.com' returns the same IP as does 'host www.mydrupallocal.com'?