#htmx #kirby
if (kirby()->request()->is('POST')) {
if(!kirby()->request()->header('HX-Request')){
go('membersarea');
}
kirby()->response()->code(202)->header('HX-Redirect', url('/membersarea'));
}
or in plain PHP (most barebone example, e.g. getting headers can be a bit tricky)
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset(getallheaders()['Hx-Request'])) {
header("Location: /membersarea");
}
header('HX-Redirect: /membersarea');
}