I've a strange problem with PHP function header('location:anylink'); and is not a coding issue as the exact same script (is my script) works fine in other installations. Have checked it in at least 10 other websites from my clients, with different server configurations and works fine.
An example: I've in my code a check to see if the article id exists in database. If does not exists, it redirects to homepage. If exists, it shows the article page.
Some tests where the article id does not exists and (correctly) redirects to Blog homepage:
https://www.hostbignet.com/blog.php?do=article&id=400
https://oraclewebhost.org/blog.php?do=article&id=400
and here is the link in my site. As you can see it continue code execution and it shows the page, of course with empty data.
https://www.whmup.com/blog.php?do=article&id=400
Have tried at least a dozen of suggestions that I found here in similar issues but nothing changed. I used ob_start, I wrote Location instead location, I let space before URL, I added exit and exit() below redirection. Nothing solved the issue.
My code is (I tried even with adding the domain name before):
// Redirect Back
header('location:blog.php');
In addition. I even tried with window.location.href and window.location.replace Nothing again.
My server is CentOS 7 with CWP Pro.
Thank you Chris