Commit a25e6b89 authored by Dominik Hebeler's avatar Dominik Hebeler

Merge branch '974-language-redirection-ignoring-url-parameters' into 'development'

Resolve "Language redirection ignoring url parameters"

Closes #974

See merge request !1611
parents 78967289 1e19933d
......@@ -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