1
0

Added a proxy for use with index.php/$1 and rewrote redirects to work with sgni.nl

This commit is contained in:
2017-03-29 17:09:21 +02:00
parent 1f9f6478e6
commit cb4a743c2a
8 changed files with 131 additions and 26 deletions

View File

@ -16,20 +16,11 @@ namespace Inforbank\Application\Helper;
class Redirect
{
public static function create($response, $path)
public static function create($request, $response, $path)
{
$basePath = $request->getUri()->getBaseUrl();
$response = $response->withStatus(302);
$response = $response->withHeader('Location', Redirect::getBasepath() . $path);
$response = $response->withHeader('Location', $basePath . $path);
return $response;
}
private static function getBasepath()
{
if (isset($_SERVER['HTTPS'])) {
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
} else {
$protocol = 'http';
}
return $protocol . "://" . $_SERVER['HTTP_HOST'];
}
}