Custom 404 Error Page Not Found

I am trying to create a custom 404 error page for my site. I created a 404.php file using the instructions from :http://www.dialme.com/articles/entry/Create-a-Custom-404-Error-Page and I have included the following line in my .htaccess :

 

ErrorDocument 404 /404.php

But when I try to generate an error, I get the message:

 

404 Error

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

If I navigate directly to the 404.php page , I can see it.

 

Can anyone help. Thanks.

Quote · 8 Apr 2009

Here is my .htaccess which works for what I am doing.  Maybe this will help?

Copy the code into your editor and go from there. :)

AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
ErrorDocument 404 /404.php

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

Quote · 8 Apr 2009

Make sure that your 404.php file is bigger than 512 bytes in size.  If it isn't, Internet Explorer will use a built in 404 error message instead of your custom 404.php

.

If you can access your error page directly, this is probably the problem.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 8 Apr 2009

My 404.php file is 2.2KB and the error message that is coming up is not from internet explorer.

 

I have tried including the changes Medfortite suggested , so my .htaccess looks like:

 

Options -MultiViews -Indexes

 

AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
ErrorDocument 404 /404.php

 

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

 

<IfModule mod_rewrite.c>

....

 

 

But now I can't view the site and it wants to download the dolphin folder to my desktop. It comes up with the message "Do you want to save the file, or find a program online to open it?".

 

Any ideas please? Is this anything to do with Permalinks? Or is it because I did not create the 404.php with the new page builder in the Admin panel? Any input would be welcome.

Quote · 8 Apr 2009

ErrorDocument 404 /404.php   is all you should need in .htaccess for it to work.   All of that other stuff has nothing to do with 404 documents and is irrelevant.


.

If you can access your 404.php document directly, and it is over 512 bytes in size, then you should contact your hosting company.   They probably do not allow custom 404 documents.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 8 Apr 2009

Has anyone successful put a custom 404 error page for their site. If so , please can you help with this.

HoustonLively - Thanks for your response but I'm on vps with my host so doubt that is the problem.  

 

Quote · 8 Apr 2009

Has anyone successful put a custom 404 error page for their site. If so , please can you help with this.

HoustonLively - Thanks for your response but I'm on vps with my host so doubt that is the problem.

I have... it's a html instead of php file.  I don't recall doing anything to the htaccess.

Quote · 9 Apr 2009

Gameutopia, perhaps you can help with this?

Synergy thanks for your input,Im using a 404.php file which may be why its not working. If all else fails will convert to 404.html and see what that does. Though I am surprised that you seem not to have changed your .htaccess. Its got me thinking if I am modifying the correct .htaccess file, there are quite a few in different folders, difficult to know which one to use

 

Quote · 9 Apr 2009

I have assumed all along that your 404.php file and .htaccess file reside in your sites root directory.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 9 Apr 2009

yes, they are in the root folder (same location as index.php)

Quote · 9 Apr 2009

Btw I solved the issue by writing the full url for the 404.php e.g http://www.mysite.com/404.php

Quote · 3 May 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.