On Fri, May 20, 2005 at 12:58:30PM +0100, Jason Corcoran wrote:
> I am trying to set up some subdomains on the machine so www.example.com goes to /var/www/html and test.example.com goes to /var/www/testhtml
You need something like:
<VirtualHost *>
ServerName www.example.com
DocumentRoot /var/www/html/
</VirtualHost>
<VirtualHost *>
ServerName test.example.com
DocumentRoot /var/www/testhtml/
</VirtualHost>
> <VirtualHost *>
> # primary vhost
> DocumentRoot /var/www/html
> RewriteEngine On
> RewriteRule ^/.* /var/www/html/index.html
> # # ...
> </VirtualHost>
Without a Servername, this becomes the default vhost, but that's no
problem.
> #
> # <VirtualHost *>
> DocumentRoot /var/www/html/sub1
> ServerName test.jcorcoran.net
> ServerPath /sub1/
Is the <VirtualHost> line really commented out? Do you really
need ServerPath?
> RewriteEngine On
> RewriteRule ^(/sub1/.*) /var/www/html$1
These rules are probably not what you want either. Either way, you
never point anything at a testhtml directory :)
--
Colm MacCárthaigh Public Key: colm+pgp at stdlib.net
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!