Just had the same problem. Patched it this way (but the other solutions seems more robust):
$location=dirname($_SERVER['PHP_SELF'])=='/' ? '' : dirname($_SERVER['PHP_SELF']);
header('Location: '.$location.'/install/index.php'); // [TODO] change this to a meta redirect
This issue is fixed in the patch attached to
http://wgmdev.com/jira/browse/CHD-1808.