Added a proxy for use with index.php/$1 and rewrote redirects to work with sgni.nl
This commit is contained in:
@ -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'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user