var/www/pages/index.php : improve look of URLs

This commit is contained in:
codeberg.org 2020-05-04 23:47:35 +02:00
parent ee47caf42d
commit 03508f2470
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ $command = "sh -c \"cd '$git_root' && /usr/bin/git ls-tree 'master:$file_url' >
exec($command, $output, $retval);
if ($retval === 0) {
if (substr($request_url, -1) !== "/") {
$h = "Location: https://" . $_SERVER["HTTP_HOST"] . "/" . $owner . "/" . $file_url . "/";
$h = "Location: $request_url/";
if ($_SERVER['QUERY_STRING'] !== "")
$h .= "?" . $_SERVER['QUERY_STRING'];
header($h);