Forum Moderators: phranque

Message Too Old, No Replies

htaccess 404 partial

         

ziphran

10:26 am on Nov 28, 2007 (gmt 0)

10+ Year Member



Hi all,

Currently I am trying to enable a simple custom 404 error page via my htaccess file.

It works fine when I go to any url without a file extension on the website.

For example, www.mydomain.com/blahblah brings up my custom page just fine.

However, if i type in www.mydomain.com/blahblah.(html¦htm¦php¦asp¦etc) it leads to the standard, non-custom, 404 error page.

Anyone have any clue why this occurs?

Here is my code in htaccess:
ErrorDocument 404 / [mydomain.com...]
also used
ErrorDocument 404 / 404error.html

jdMorgan

10:59 pm on Nov 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Neither directive above is correct. The correct syntax is:

ErrorDocument 404 /404error.html

Jim

ziphran

1:05 am on Nov 29, 2007 (gmt 0)

10+ Year Member



Sorry Jim,

I just typed them in rather quickly. Both had no space after the "/" in the statement.

Was heading out to work. I am still having this issue however.

Any other ideas Jim?

And thanks in advance!

ziphran

8:32 am on Nov 30, 2007 (gmt 0)

10+ Year Member



Anyone?

g1smd

10:59 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This should work just fine:

ErrorDocument 404 /404error.html

Make sure you flush your browser cache and try again.

ziphran

12:10 am on Dec 1, 2007 (gmt 0)

10+ Year Member



It works.

However, it only works if I do not include a file extension in my link.

IE www.mydomain.com/blah <--- Will show custom 404
www.mydomain.com/blah/html <--- will show providers 404

jdMorgan

2:08 am on Dec 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This behaviour is inexplicable -- at least on a normally-configured server with no other URL-rewriting directives or scripts involved. I suggest you ask your host about this.

Jim