Discuz论坛用带有页眉与页脚的404页面 
 
代码如下(7.2): 
 
- <?php
 
 - define('CURSCRIPT', 'index');
 
 - require_once './include/common.inc.php';
 
 - include template('header');
 
 - print <<<HTML
 
 - <div id="nav"><a href="$indexname">$bbname</a> » 您打开的页面不存在</div>
 
 - <div id="wrap" class="wrap s_clear">
 
 - <style type="text/css">
 
 - <!--
 
 - .txt404 {
 
 -     line-height:120px;
 
 -     text-align:center;
 
 -     height:240px;
 
 -     padding:120px 0px;
 
 -     font-weight: 600;
 
 -     font-family: Verdana, Arial, Helvetica, sans-serif;
 
 -     overflow:hidden;    
 
 - }
 
 - .txt404 p{
 
 -     padding:0px;
 
 -     margin:0px;
 
 -     color: #FF6600;    
 
 -     font-size: 130px;
 
 - }
 
 -     
 
 - .txt404 p.notfound {
 
 -     color:#e5e5e5;
 
 -     font-size:80px;
 
 - }
 
 - -->
 
 - </style>
 
 - <div class="txt404">
 
 - <p>404</p><p class="notfound">not found</p>
 
 - </div>
 
 - </div>
 
 - HTML;
 
 - include template('footer');
 
 - ?>
 
  复制代码 
 
代码如下(2.0): 
 
- <?php
 
  
- require './source/class/class_core.php';
 
  
- $discuz = & discuz_core::instance();
 
 - $discuz->cachelist = $cachelist;
 
 - $discuz->init();
 
 - $navtitle = '404';
 
  
- include template('common/header');
 
  
- print <<<HTML
 
 - <div id="pt" class="bm cl"><div class="z"><a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>»</em>你访问的页面不存在</div></div>
 
 - <style type="text/css">
 
 - .txt404 {
 
 -     line-height:130px;
 
 -     text-align:center;
 
 -     height:260px;
 
 -     padding:110px 0px;
 
 -     font-weight: bold;
 
 -     font-family: Georgia, "Times New Roman", Tahoma, Verdana, Arial;
 
 -     overflow:hidden;   
 
 - }
 
 - .txt404 p{
 
 -     padding:0px;
 
 -     margin:0px;
 
 -     color: #FF6600;   
 
 -     font-size: 140px;
 
 - }   
 
 - .txt404 p.notfound {
 
 -     color:#e5e5e5;
 
 -     font-size:80px;
 
 - }
 
 - </style>
 
 - <div class="txt404"><p>404</p><p class="notfound">not found</p></div>
 
 - HTML;
 
  
- include template('common/footer');
 
  
- ?>
 
  复制代码 
 
保存为404.php上传到论坛 
然后修改.htaccess文件的404页面为404.php |   
 
 
 
 | 
| 
 | 
| 
 |