Skip to content

Commit

Permalink
Redirect postcode searches to postcode page.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed May 23, 2024
1 parent 3d31f78 commit aea839b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions www/docs/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
include_once INCLUDESPATH . "easyparliament/glossary.php";
include_once INCLUDESPATH . 'easyparliament/member.php';

$q = get_http_var('q');
$q = preg_replace('#[^a-z0-9]#i', '', $q);
if (validate_postcode($q)) {
header("Location: /postcode/?pc=" . urlencode($q));
exit;
}

if (!DEVSITE) {
header('Cache-Control: max-age=900');
}
Expand Down

0 comments on commit aea839b

Please sign in to comment.