com and .co.uk domains, is it possible to create a virtual host to point to a single directory on the box?
At present I have
<VirtualHost *:80> ServerName www.domain.co.uk ServerAlias domain.co.uk DocumentRoot "C:/htdocs/domain.com/htdocs" <Directory /> Options +Includes </Directory> ErrorLog "C:/htdocs/domain.co.uk/logs/error.log" CustomLog "C:/htdocs/domain.co.uk/logs/access.log" combined
Yes just add them to your ServerAlias
ServerAlias domain.co.uk www.domain.com domain.com
Or you could do it like this:
ServerName domain.co.uk ServerAlias *.domain.co.uk domain.com *.domain.com
I think you have som inconsistency problems with your posted code. Using both
If it was up to me. I would put everything in
C:/htdocs/domain.com/ and use the following
<VirtualHost *:80> ServerName domain.com ServerAlias *.domain.com domain.co.uk *.domain.co.uk DocumentRoot "C:/htdocs/domain.com/htdocs" <Directory /> Options +Includes </Directory> ErrorLog "C:/htdocs/domain.com/logs/error.log" CustomLog "C:/htdocs/domain.com/logs/access.log" combined </VirtualHost>
Please note, when using
*.domain.com (star-alias) in ServerAlias. If you wish to add a specific subdomain (example delicious-subs.domain.co.uk) in a new VirtualHost – pointing to another location. Then you will have to add that new VirtualHost with above/before the VirtualHost using the star-alias.