views:

28

answers:

2

I have .htaccess already configured:

ErrorDocument 404 error.php

But whenever I go to an invalid page, it should display the 404 page, but it just shows:

"error.php"

Just blank white, just the text of the php file only...

The file and .htaccess does exist.

Inside 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"); ?>
+2  A: 

What's inside your error.php ?

Maybe also add a slash in your htaccess

ErrorDocument 404 /error.php
Harry
+1  A: 

As Harry said, the slash may be needed, but you would need it to the full path to the file from the .htaccess file.

For example, if your error.php is in a directory, it should look like this:

ErrorDocument 404 /folder/error.php

John