Now all the sub domains are pointing to the server. But there is no virtual
host entry for it. So you will get the Apache page.
You just need to edit the virtual host entries for that particular domain. Add
a ServerAlias " *.domain-name.com ".
Example:
<VirtualHost IP:443>
ServerName domain-name.com
ServerAlias *.domain-name.com
DocumentRoot /home/user/public_html/
....................
.............
</VirtualHost>
The restart Apache.
Now accessing any sub domains will give up the main website page.
This is not what you are looking for. You want the sub domains to point to its
respective folder.
Example:
Accessing " test.domain-name.com ", should point to the test folder under "
public_html " directory.
To get this done, we can use Rewrite conditions.
|