prepare("SELECT * FROM pages WHERE slug = ?"); $stmt->execute([$slug]); $page = $stmt->fetch(); if (!$page) { http_response_code(404); // You can create a more sophisticated 404 page include 'includes/header.php'; echo "
Sorry, the page you are looking for does not exist.