Page 1 of 1

About 404 Error Page..

PostPosted: 31. January 2005 18:56
by keisko
Hello all..

I want change httpd.conf file for customized 404 error page! I did it..
I have changed httpd.conf line to "ErrorDocument 404 /error/missing.html "
missing.html file is my customized html file...
but When I entered a fake page for looking error results so its showing old message in browser, like "Not Found The requested URL /mambo/fsd was not found on this server.Apache/2.0.52 (Win32) mod_ssl/2.0.52 OpenSSL/0.9.7e PHP/5.0.3 Server at xxx.xxxx.xxxx... Port 80"

Why It isn't attempt to view for missing.html ??
and Why xampp directory have 2 httpd.conf file ?? (C:\xampp\apache\conf\httpd.conf) and (C:\xampp\php\httpd5.conf)

note: I am using php5..

Regards...

PostPosted: 31. January 2005 19:10
by Wiedmann
and Why xampp directory have 2 httpd.conf file ?? (C:\xampp\apache\conf\httpd.conf) and (C:\xampp\php\httpd5.conf)

httpd.conf != httpd5.conf

These are different names, or not? BTW: http://localhost/xampp/phpswitch.php

I have changed httpd.conf line

Which line? (number)

PostPosted: 31. January 2005 19:20
by keisko
Wiedmann wrote:httpd.conf != httpd5.conf

These are different names, or not? BTW: http://localhost/xampp/phpswitch.php


Switch?? Why I need that ? If I want to switch for php4 or php5 I am using php-switch.bat

Wiedmann wrote:Which line? (number)


line 900, col 23

here:



Code: Select all
IfModule mod_include.c>
    Alias /error/ "C:/xampp/apache/error/"

    <Directory "C:/xampp/apache/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>

    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
    ErrorDocument 404 /error/missing.html
    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
    ErrorDocument 410 /error/HTTP_GONE.html.var
    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
    ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var


I have changed /error/HTTP_NOT_FOUND.html.var to /error/missing.html in C:\xampp\apache\conf\httpd.conf and C:\xampp\php\httpd5.conf

missing.html is my new customized 404 error not found page..

Regards...

PostPosted: 31. January 2005 19:23
by keisko
and I need change another line or another file for 404 page ?? I have changed only that lines...

PostPosted: 31. January 2005 19:47
by Wiedmann
Switch?? Why I need that ? If I want to switch for php4 or php5 I am using php-switch.bat

You have read this page?

<IfModule mod_negotiation.c>
IfModule mod_include.c>
...
ErrorDocument 404 /error/missing.html

This line have only an effect, if mod_negotation is loaded. Only with mod_negotation you can use the URL "/error" and path "\xampp\apache\error".

Change line ~854 instead:
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

filepath in this example: "\xampp\htdocs\missing.html"

PostPosted: 31. January 2005 19:55
by keisko
Wiedmann wrote:
Switch?? Why I need that ? If I want to switch for php4 or php5 I am using php-switch.bat

You have read this page?

<IfModule mod_negotiation.c>
IfModule mod_include.c>
...
ErrorDocument 404 /error/missing.html

This line have only an effect, if mod_negotation is loaded. Only with mod_negotation you can use the URL "/error" and path "\xampp\apache\error".

Change line ~854 instead:
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

filepath in this example: "\xampp\htdocs\missing.html"


How Can install mod_negotation or How can I check it for installed already or not..

or

Can I use .htaccess for error page..??

.htaccess

ErrorDocument 404 http://mydomain.cc/error.html

is this works??

PostPosted: 31. January 2005 21:01
by keisko
Ok I has been solved that problem.. you were right dude.. It's need mod :)
I actived it, now it's work..

Thank for your help!

Best Regards...

PostPosted: 14. February 2005 16:46
by HyE
Please can someone show me step-by-step which files i should change to get custom 404 error message please, i followed all this but still cannot get it work. :(
Please if you can help me thanks

this is what i have
Code: Select all
Apache/2.0.52 (Win32) mod_ssl/2.0.52 OpenSSL/0.9.7e PHP/5.0.3 Server

PostPosted: 18. February 2005 16:49
by HyE
Please. someone help me thanks

PostPosted: 12. March 2005 12:51
by prathapml
Make whatever custom 404 error page you want, and save as "404.html" in htdocs.
Then, just make a file called ".htaccess" and put it in htdocs folder. It has to be a plain-text file, with these lines:
Code: Select all
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
and so on..... for whichever error code you want to customize.


No need to edit httpd.conf now, as whatever you have in htdocs will propagate to all folders below it.