getHost() !== 'localhost') { return false; } // Check if there are query parameters in the URL if ($url->getQuery() !== '') { return false; } // Check if the path is exactly '/' return $url->getPath() === '/'; } }