The first thing that came to mind was to do the obvious but that didn't work (because of the VHOST) so I went through RFC 2616 and found something in section XX.2. Am I going in the right direction?
The idea is that you solve the problem. Please stop keep asking for hints; it's very clear you want them, but I also think it is clear you aren't getting them.