Apache 404 Error |
Author: |
Message: |
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
O.P. Apache 404 Error
I want a customised 404 error page for my server, the page works, but my server does not show the page when a wrong url is typed.
How do I Configure Apache to show the customised 404 error page?
TIA
|
|
09-10-2004 09:59 AM |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
Joined: Oct 2003
|
RE: Apache 404 Error
In .htaccess, enter the following line:
ErrorDocument 404 <url-to-404-page>
|
|
09-10-2004 10:26 AM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
O.P. RE: Apache 404 Error
Already did that, it's not working
|
|
09-10-2004 10:28 AM |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
Joined: Oct 2003
|
RE: Apache 404 Error
I don't actually know Apache very well, but you have to have .htaccess in the root of your website. Whether you have to have it elsewhere I don't know.
|
|
09-10-2004 10:30 AM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: Apache 404 Error
You don't need a .htaccess file anywhere, especially if it's your own server, because all that stuff could just be configured through httpd.conf.
See http://httpd.apache.org/docs-2.0/mod/core.html.en#errordocument for examples/info about using ErrorDocument.
quote: Originally posted by Ezra
Already did that, it's not working
Maybe you could post the code you used? And where is the error document located?
|
|
09-10-2004 04:33 PM |
|
|
Mippo
Elite Member
MJBZ!
Posts: 568 Reputation: 26
34 / / –
Joined: Apr 2003
|
RE: Apache 404 Error
I think usually .htaccess files are overridden unless it's changed in httpd.conf (or is it just me? ) But if its your own server, using the httpd.conf for ErrorDocuments and stuff is handy
|
|
09-10-2004 05:17 PM |
|
|
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
RE: Apache 404 Error
iirc, you can set your desired 404 target URL in the httpd.conf file.
|
|
09-10-2004 05:43 PM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
O.P. RE: Apache 404 Error
I tried but I don't really know how all of it works.
There was this line in this httpd file with #ErrorDocument 404 /missing.html and I deleted the #, and named the customized 404 page missing.html.
But still no luck
|
|
09-10-2004 06:59 PM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: Apache 404 Error
And where is missing.html? I think it should be in the root directory of your web site. Also, make sure it's larger than 512 bytes, because IE doesn't like small error pages.
|
|
09-10-2004 07:24 PM |
|
|
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
RE: Apache 404 Error
You should probably give the config an absolute path to your 404 page (since we don't know to what /missing.html is relative). For example:
ErrorDocument 404 C:/apache/htdocs/missing.html (try also using backslashes)
|
|
09-10-2004 07:46 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|