Mapping sub-domain to sub-directory
There are at least 3 ways to map sub domains to sub directories (i.e. http://sub.name.tld to /home/name.tld/web/public/sub) using mod_vd, mod_vhost_alias or mod_rewrite. The following procedure uses mod_vhost_alias:
- Append to bottom of the file /opt/csw/apache2/etc/virtualhosts/domain.conf the code as shown bellow (abc is arbitrary)
- Repeat for every domain you would like to have this feature
- Restart Apache using Webmin.
<VirtualHost 8.11.22.123:80>
ServerName abc.domain.com
ServerAlias *.domain.com
VirtualDocumentRoot /home/domain.com/web/public/%-3
</VirtualHost>