sharma wrote:
Hi Dani,
When a user submits the registration form , how did this virtual host
create from php script? Any idea...
Usually, they won't. There are lots of way to do it with virtual
host directive. Most simplest thing is to use ServerAlias...
<VirtualHost *>
....
ServerName example.com
ServerAlias *.example.com
....
</VirtualHost>
Now, anything like a.example.com or b.example.com will be served
with example.com's content.
Now, you actually want to serve different pages for a.example.com
and b.example.com. So, you have to see what is the requested subdomain
(whether it's "a" or "b"). In PHP, you can see it through $_SERVER
variables or may again use mod_rewrite to send the subdomain request to
a php file as query string like index.php?subdomain=%1 or so.
So, you basically have only one index.php file, but will have
different requests coming (via subdomain). index.php can serve
different pages depending upon the request.
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog:
http://rajeshanbiah.blogspot.com/