I am trying to modify HTTP header for current URL. I want to set 410 status if current page header is 404.
below code iI used but iI have created new controller so it always set 410 for that controller but iI want to set for current urlURL.
$resultPage = $this->resultPageFactory->create();
$resultPage = $this->resultPageFactory->create();
$resultPage->setStatusHeader(410, '1.1', 'Gone');
$resultPage->setHeader('Status', '410 Gone');
return $resultPage;
I am not sure which function used to set Http header. Has anyone has idea?