I spent the best part of today debugging the living daylights out of this so I'll expect VERY GOOD bug reports back if this breaks. (anyone who responds with the equivalent of "it doesn't work" will be summarily taken outside and given a wedgy by Bob The Dinosaur (see Dilbert cartoons, circa 1989))
This works on my installs:
1. vhosts: installed into the root and into folders.
2. folders: installed into the root and into folders.
This code is so fresh and so much has changed that it's liable to break. I want everyone to test it on a spare server before putting it live! I'm not putting this baby on wordpress.com just yet as so much has changed.
I leave you with this inspirational message: PLEASE TEST! PLEASE TEST! PLEASE SEND CODE PATCHES!