Commit 1e19933d authored by Dominik Hebeler's avatar Dominik Hebeler

fixed redirect to include query parameters

parent 78967289
......@@ -25,26 +25,22 @@ class LocalizationRedirect
return $next($request);
}
$url = url()->full();
$url = preg_replace("/^http:\/\//", "https://", $url);
if($host !== "metager.de" && $locale == "de"){
$url = $request->url();
$url = str_replace($host, "metager.de", $url);
$url = preg_replace("/^http:\/\//", "https://", $url);
$url = preg_replace("/^(https:\/\/[^\/]+)\/de/", "$1", $url);
return redirect($url);
}
if($host !== "metager.es" && $locale == "es"){
$url = $request->url();
$url = str_replace($host, "metager.es", $url);
$url = preg_replace("/^http:\/\//", "https://", $url);
$url = preg_replace("/^(https:\/\/[^\/]+)\/es/", "$1", $url);
return redirect($url);
}
if($host !== "metager.org" && $locale == "en"){
$url = $request->url();
$url = str_replace($host, "metager.org", $url);
$url = preg_replace("/^http:\/\//", "https://", $url);
$url = preg_replace("/^(https:\/\/[^\/]+)\/en/", "$1", $url);
return redirect($url);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment