Update index.php
Added method to determine root url, when not in document root
merge