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
Merge pull request #9 from symfony/2.2

Merge symfony/standard with Lexance/symfony-multidomain [2.2]