2010-05-31 53 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