I've commented out this block since main.php has to exist, as your comments say. We won't be checking if it exists. // See if $content_file exists. If it does not, redirect to the homepage. if (!file_exists($content_file)) { //if I comment out this header line then the error goes away //but I see only the header and not anything else header("Location: {$_SERVER["PHP_SELF"]}"); exit(); } */ ?> <?=$title ?>