2010-05-31 50 views
1

的.htaccess已经配置:404的ErrorDocument问题

的ErrorDocument 404 error.php

但每当我去到一个无效的页面时,它应显示404页,但它只是显示:

“error.php”

只是空白,只是php文件的文本...

文件和.htaccess确实存在。

内error.php:

<?php $title = "Error 404 - Page Not Found"; include("include/glob_header.php"); ?> 

<div class="content_wrap"> 
    <div class="main_content_wrap"> 
     <div class="main_content"> 
      <h2>Error 404 - Page Not Found</h2> 

      <p><div align="center"><img src="img/HS.gif" alt="" /></div><hr /></p> 

      <p>The page you have requested could not be found.</p> 

      <ul> 
       <li>The page you were looking for may have been deleted...</li> 
       <li>The page may have been moved...</li> 
       <li>... or possibly the page does not even exist!</li> 
      </ul> 

      <p>Click <a href="index.php">here</a> to go back to the home page</p> 

      <p>... or go back the <a href="javascript: history.go(-1);">previous</a> page</p> 

     </div> 
    </div> 

    <div class="sidebar_content_wrap"> 
     <div class="sidebar_content"> 
      <h2>Latest News</h2> 

      <?php include("include/glob_sidebar.php"); ?> 

     </div> 
    </div> 
</div> 

<?php include("include/glob_footer.php"); ?> 

回答

3

什么是你的error.php里?

也许也在你的htaccess

ErrorDocument 404 /error.php 
1

哈利说,可能需要斜杠添加斜线,但你会需要它的完整路径从.htaccess文件的文件。

例如,如果你的error.php是一个目录,它应该是这样的:

ErrorDocument 404 /folder/error.php

0

我认为你需要配置

+0

这个问题被回答过两年allowoverwrite前 – LittleBobbyTables 2012-10-05 22:31:24