HEAD requests all return a 404 |
CI Version- v4.1.9
All my head request , even on working pages of my websites inner pages ( https://www.mediyaar.com/blood-test/ ) are returning a 404 response . Problem - Any page that returns a 200 on a Get request , gets a 404 on head request. Expected out put - Head request should return 200 if page exist. Below is the page code ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <?php namespace App\Controllers; use App\Models\ProfileModel; class BloodTest extends BaseController { public function __contruct() { error_reporting(0); } public function index(){ $header_data=[]; $footer_data=[]; $data=[]; $db = \Config\Database::connect(); $ProfileModel=new ProfileModel($db); $header_data['title']='Blood test at Home | Book online at low cost.'; $header_data['keyword']='Blood Test at Home'; $header_data['description']='Blood test at home , Get a lab test near me , Book online at low prices'; $header_data['breadcrumb_shema']= '{ "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Home", "item": "'.base_url().'" },{ "@type": "ListItem", "position": 2, "name": "Blood Test", "item": "'.base_url().'/blood-test/" }] }'; $data['popular_profiles']=$ProfileModel->getBloodTest(); $data['mediyaar_profiles']=$footer_data['mediyaar_profiles']=$ProfileModel->get_mediyaar_profiles_home(); echo view('layouts/header_pathology_labs',$header_data); echo view('blood_test',$data); echo view('layouts/footer_pathology_labs',$footer_data); } }
You need to add the route for the HEAD method manually.
For example: PHP Code: $routes->get('xxx', ...);
It worked like magic , Infact no professional on upwork was able to solve this puzzel .
thanks for your great advice . cheers |
Welcome Guest, Not a member yet? Register Sign In |