ports.php: Sync redirects with new ports website

Fixes https://github.com/macports/macports-webapp/issues/321
This commit is contained in:
Arjun Salyan
2024-03-29 11:19:03 +01:00
committed by Clemens Lang
parent a43d67ba07
commit 182e8aeee1
+5 -4
View File
@@ -6,14 +6,15 @@ $by = isset($_GET['by']) ? $_GET['by'] : '';
$substr = isset($_GET['substr']) ? $_GET['substr'] : '';
$seeother = false;
$newurl = $portdb_url;
// URL for "All Ports" page [ports.macports.org/search/]
$newurl = $portdb_url . 'search/';
switch ($by) {
case 'name':
case 'library':
$newurl .= '?search=' . rawurlencode($substr) . '&search_by=name';
$newurl .= '?q=' . rawurlencode($substr) . '&name=on';
break;
case 'category':
$newurl .= 'ports/category/' . rawurlencode($substr);
$newurl .= '?selected_facets=categories_exact:' . rawurlencode($substr);
break;
case 'maintainer':
/* ports.macports.org only groups by GitHub user, probably not worth
@@ -21,7 +22,7 @@ switch ($by) {
$seeother = true;
break;
case 'variant':
$newurl .= 'ports/variant/' . rawurlencode($substr);
$newurl .= '?selected_facets=variants_exact:' . rawurlencode($substr);
break;
case 'platform':
/* ports.macports.org does not allow searching by platform. */