Looks like a copy from [GPLv2 licensed code](https://github.com/ColdTrick/maintenance/blob/master/start.php#L17). Did you clear it with @jdalsem ?

I thought about using `parse_url` here, but this approach gets around subdirectory installations easily. LGTM