1

我已经配置了.htaccess

错误文档 404 错误.php

但是每当我转到无效页面时,它应该显示 404 页面,但它只是显示:

“错误.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"); ?>
4

3 回答 3

3

你的 error.php 里面有什么?

也许还可以在您的 htaccess 中添加一个斜杠

ErrorDocument 404 /error.php
于 2010-05-31T22:08:35.747 回答
1

正如哈利所说,可能需要斜杠,但您需要将它作为 .htaccess 文件中文件的完整路径。

例如,如果您的 error.php 在目录中,它应该如下所示:

ErrorDocument 404 /folder/error.php

于 2010-05-31T22:31:14.300 回答
0

我认为您需要配置allowoverwrite

于 2012-08-25T04:46:22.243 回答