Take into account the install subdirectory when redirecting users because of access denied. Fixes #2259.