Forum Moderators: phranque

Message Too Old, No Replies

Custom 404 ErrorDocument does not work

Apache default error page showing

         

webstyler

11:37 am on Feb 19, 2006 (gmt 0)

10+ Year Member



I have this simple row on my .htaccess
ErrorDocument 404 /index.php

But I always see default page and not this.

?
thks

stapel

1:38 pm on Feb 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



webstyler said:
I have this simple row on my .htaccess
ErrorDocument 404 /index.php

But I always see default page and not this.

But isn't "index.php" your default page...? So the .htaccess directive is serving up exactly what you asked for...?

If you want to serve up a custom 404 page, make a separate page, named something like "404error.php", and put that in the ErrorDocument directive.

Eliz.

webstyler

2:37 pm on Feb 19, 2006 (gmt 0)

10+ Year Member



Hi,
for default page I mean default error apache page.

I have try other page as

ErrorDocument 404 e404.html
ErrorDocument 404 /e404.html
..

but I get ever standard 404 page not found..

?

Thks

jdMorgan

3:35 pm on Feb 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is AllowOverride [httpd.apache.org] FileInfo set on your server? This is stated as a requirement for ErrorDocument [httpd.apache.org].

Jim

webstyler

4:20 pm on Feb 19, 2006 (gmt 0)

10+ Year Member



uhm.. how can I set in my htaccess?

thks

jdMorgan

4:23 pm on Feb 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't -- It's a server configuration setting.

Please click on the links above and read the "specifications" at the top of each directive's description - It tells you where the directive can be used, and notes the dependencies.

Jim

webstyler

4:38 pm on Feb 19, 2006 (gmt 0)

10+ Year Member



Hi Jim, yes thks

but, I have in my httpd.conf

AllowOverride All

This not covered my need?

Thks

jdMorgan

3:14 pm on Feb 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



AllowOverride All should be sufficient.

Take a look at your server error logs after requesting a non-existent page; The only other thing I can think of is that perhaps your errordocument location is incorrect -- maybe Apache can't find your custom error page. If so, this would show in the error log.

Also, remember to always flush your browser cache after making any change to your configuration files.

Jim

Wlauzon

7:24 pm on Feb 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



e404 is the default for many Apache servers, so you may not even have to put that in.