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.
merged branch Tobion/redirect-subdir (PR #530)

This PR was merged into the 2.2 branch.

Discussion
----------

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

Commits
-------

3a4f0e7 fix redirect when project is installed in subdirectory