I cannot figure out what could be causing this error. My Apache log is not recording any errors in the access log or error log regarding the page, yet somehow whenever I unc
Try to use a fully formed URL:
header("Location: http://{$_SERVER['HTTP_HOST']}/offices/page-".ceil($cache->size() / 15));
The script continues to execute after your header() call. You need put exit;
immediately after it. This shouldn't cause a 500 error, though.
Edit: Evidently this worked - meaning your problem is probably in some related code further down the page?
I had the same thing going on. After repeatedly banging my head on the monitor, it isn't the header("Location: myPage.php"); line that is broken - it is myPage.php that is broken! Try redirecting to another page. I hope I save someone else time
Another reason might be - you need to remove space after location
:
header("location :
header("location:
If that's not your problem, then try to check the php & apache error logs.