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.
fixed access check: allow local link addresses and prevent access when XFF/HTTP_CLIENT_IP is set
merged branch bes89/update-access-check (PR #531)

This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #531).

Discussion
----------

fixed access check

allow local link addresses and prevent access when XFF is set (the same as in app_dev.php)

Commits
-------

4c34555 fixed access check: allow local link addresses and prevent access when XFF/HTTP_CLIENT_IP is set
Merge branch '2.1' into 2.2

* 2.1:
  fixed access check: allow local link addresses and prevent access when XFF/HTTP_CLIENT_IP is set
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
fix rewrite base detection for root of alias
merged branch Tobion/rewritebase-root (PR #540)

This PR was merged into the 2.2 branch.

Discussion
----------

fix rewrite base detection for root of alias

Bc break: no
Fixes #536

@fabpot please also merge 2.2 in to master then.

Commits
-------

680f09b fix rewrite base detection for root of alias
Merge branch '2.2'

* 2.2:
  fix rewrite base detection for root of alias
  fixed access check: allow local link addresses and prevent access when XFF/HTTP_CLIENT_IP is set
  fix redirect when project is installed in subdirectory