Cool, thanks for that.
Basically you only want to use a virtualhost if it's a different domain (domain-play.co.uk) or a different subdomain (play.domain.co.uk), so you won't need to do that here.
From what you've said, there might be two things you're trying to do. You might just be trying to change the index file, or you might be trying to set up the play directory outside the main document root.
If you just want to give the play directory a different index file, change your config to:
Code:
# Bind to 127.0.0.1 port 80
NameVirtualHost 127.0.0.1:80
# Define virtual host; first one defined is the default,
# so this will catch http://127.0.0.1/ too
<VirtualHost preview.domain.co.uk>
# Basic config for domain
DocumentRoot C:/xampp/htdocs/
ServerName preview.domain.co.uk
ServerAdmin admin@preview.domain.co.uk
# Ensure file system directory is allowed
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#
# Set the play directory to have a different index document
# This is the important bit:
#
<Directory "C:/xampp/htdocs/play">
DirectoryIndex index_site.php
</Directory>
</VirtualHost>
However, if you want the play directory to be completely self-contained, ie contained in a directory other than the one in your DocumentRoot, you'll want to use the Alias directive:
Code:
# Starts as before:
NameVirtualHost 127.0.0.1:80
<VirtualHost preview.domain.co.uk>
DocumentRoot C:/xampp/htdocs/
ServerName preview.domain.co.uk
ServerAdmin admin@preview.domain.co.uk
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#
# Set up an alias for the play directory
# Note this path is outside the DocumentRoot
#
Alias play C:/xampp/play/htdocs
# Set up play directory permissions
<Directory "C:/xampp/play/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
# DirectoryIndex goes here
DirectoryIndex index_site.php
</Directory>
</VirtualHost>
Of course these configs aren't exhaustive, but they should point you in the right direction.
More details: