I have a Cakephp website and when I look it up in Google it shows an error in the description even though the site is working well.
The error shown:
$status = "Location: http://mywebsite.com/" header - [internal], line ??
Controller::header() - COREcake/libs/controller/controller.php, line 742
Controller::redirect() ...
I Googled "Searched the internet" for the error and found that several CakePHP websites have the same problem, they work fine but there is an error in their Google description. Meta tags are displayed correctly in the source page.
Does anybody know what wrong?
I have set the debug to zero, uploaded a site map, robots.txt file and still suffer from the same problem even Bing and Yahoo are showing the same problem now.
If any body can give me a hand that would be really appreciated.
I figured it out a week ago. I used a third-party library for browser detection since I did not feel like re-inviting the wheel. When I went though the code I noticed that the person who created it handled every browser possible. He had a series of if-elseif statements but no else statement.
if(IE){
do this
}
elseif(Firefox)
{
do that
}
... for all the browsers
the problem took place when the crawler visits the page and since the conditions can't find a browser header it was outputting an error message.
to solve the problem I just added an else condition and considered every crawler as a Firefox browser.