Skip to content

Commit

Permalink
add query forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
MuchQuak committed Oct 16, 2024
1 parent 8d95383 commit 26e926a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@
$legacy_routes = [
'index.php' => '/',
'profile/index.php' => isset($_REQUEST['submit']) && $_REQUEST['submit'] === 'logout'?
'/logout': '/login' ,
'logout': '/login' ,
'profile/newprofile.php' => '/signup',
'collections/list.php' => '/collections/list',
//'sitemap.php' => '/sitemap',
];

Expand All @@ -104,6 +105,10 @@
substr($_SERVER['REQUEST_URI'], 0, $query_pos):
$_SERVER['REQUEST_URI'];

$query = $query_pos?
substr($_SERVER['REQUEST_URI'], $query_pos):
'';

/* Clean out host url if present */
$https = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://');
$app_url = str_replace([$https, $_SERVER['HTTP_HOST']],'', $_ENV["APP_URL"]);
Expand Down Expand Up @@ -192,7 +197,7 @@
];

if($blacklist_redirect = $legacy_black_list[$uri]) {
header('Location:' . $blacklist_redirect);
header('Location:' . $blacklist_redirect . $query);
} else if(preg_match("/^\/Portal.*\.(.*)/", $uri, $matches)) {
try {
[$path, $file_type] = $matches;
Expand Down

0 comments on commit 26e926a

Please sign in to comment.