I've tried looking at other similar questions, but can't really find what I'm looking for.
I have a server running apache2, and I want all requests for www.foo.tld to serve the pages in /var/www/foo.tld
www.example.com -> /var/www/example.com example.net -> /var/www/example.net foobar.co.uk -> /var/www/foobar.co.uk www.foobar.co.uk -> /var/www/foobar.co.uk
I can't figure out how to do this. I can get it working sometimes with or without the www subdomain, but never with both.