Implemented a much stronger algorithm to find the site root relative to the document root, which should work even when the site root is in a completely different directory from the document root, as is possible with Apache aliases.