PHP 404 页面模板是指当用户访问一个不存在的页面时,服务器返回的一个自定义的错误页面。这个页面通常包含一些友好的提示信息,帮助用户理解他们访问的页面不存在,并可能提供一些导航选项,引导用户回到网站的其他部分。
以下是一个简单的 PHP 404 页面模板示例:
<?php
// 设置 HTTP 响应状态码为 404
header("HTTP/1.0 404 Not Found");
// 设置页面标题
echo "<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>404 Not Found</title>
<style>
body { font-family: Arial, sans-serif; }
.container { text-align: center; margin-top: 50px; }
h1 { color: #f00; }
p { color: #333; }
a { color: #00f; text-decoration: none; }
</style>
</head>
<body>
<div class='container'>
<h1>404 Not Found</h1>
<p>The page you are looking for does not exist.</p>
<p><a href='/'>Go back to the homepage</a></p>
</div>
</body>
</html>";
?>希望这些信息对你有所帮助!
没有搜到相关的沙龙