fix redirect when project is installed in subdirectory

When neither a vhost with proper document root nor an apache alias is configured, the redirect was to the wrong location (without the path prefix). The context_prefix env variable was not available then, so we need to use the logic to determine the RewriteBase automatically as we have done it to resolve the app.php file too.

BC break: no
fixes: https://github.com/symfony/symfony-standard/pull/497#issuecomment-16016232 and following