Forum Moderators: phranque

Message Too Old, No Replies

is it possible to alias a subdomain to a folder?

subdomain alias

         

dreamscan

6:23 am on Nov 21, 2003 (gmt 0)

10+ Year Member



Basically what I want to do is somehow add a line in my virtual hosts config file to alias a subdomain address with a folder. Below is what my current config looks like, and below that is a sample of what it would look like if I knew how to do this.

<VirtualHost *>
ServerAdmin root@dreamscan.net
DocumentRoot /domains/dreamscan/root
ServerName dreamscan.net
ServerAlias www.dreamscan.net
ErrorLog /domains/dreamscan/error_log
CustomLog /domains/dreamscan/access_log common
</VirtualHost>

So is it even possible to do something like this? I tried, but it didn't seem to work. Thanks.

<VirtualHost *>
ServerAdmin root@dreamscan.net
DocumentRoot /domains/dreamscan/root
ServerName dreamscan.net
ServerAlias www.dreamscan.net
ErrorLog /domains/dreamscan/error_log
CustomLog /domains/dreamscan/access_log common
Alias stats.dreamscan.net /domains/dreamscan/stats
</VirtualHost>

jdMorgan

5:50 am on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



dreamscan,

Welcome to WebmasterWorld [webmasterworld.com]!

You can certainly set up your server to accomplish what you want. This is not something I've done, but take a look at the Apache documentation [httpd.apache.org] for the <VirtualHost> directive (Apache core), the mod_vhost module, and the Dynamically configured mass virtual hosting document for some good examples.

Take a look at the ServeName and DocumentRoot settings under <VirtualHost> especially.

Jim