need to create sub domain.
Wildcard subdomains you create in a DNS server.
make all *.localhost/guestbook , point to locahost/guestbook
As I told before: pointing "*.localhost" to "localhost" is the job for a DNS server. In this case, the DNS server answer all questions for a hostname in the `domain` "localhost" with the same IP (here 127.0.0.1).
And the Apache webserver answers to all requests for the IP to which he listen.
You only need virtual hosts, if you have different content for different hostnames.