Having read numerous threads and tutorials round t'interweb, I'm still as confused as I was before I started! Let me explain my situation:
We have a webserver used to host all of our "websites in development" in the office. At present, each site is in its own folder within the document root. I.e. "/www/htdocs/projectname", so their URLs are: www.mywebsite.com/projectname
What I'd like to do is set up each site in development with its own subdomain, which then transparently redirects to the relevant folder, i.e. projectname.example.com to example.com/projectname
Obviously, this could be achieved with a virtual host per project, but surely this can be achieved with mod_rewrite? My DNS is set up correctly (wildcard A record), but all the examples I've tried have either broken www
.example.com, or simply redircted all subdomains to the document root.
So, does anybody have a solution?