p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 (http://p2p.wrox.com/forumdisplay.php?f=160)
-   -   CH9 - Apache not using custom error page (http://p2p.wrox.com/showthread.php?t=39020)

d2nash February 25th, 2006 09:53 AM

CH9 - Apache not using custom error page
Hi all,

I have followed the instructions in the book and edited the httpd.conf file and restarted apache, and have created the custom error page error.php and saved it in the appropriate folder but when I hit an error page within the localhost (for example the page not found error when I go to http://localhost/index.php) I am still seeing the standard internet explorer 'page not found' rather then the error.php page.

Can anyone help me figure out what I've missed?

I have changed the httpd.conf file so that it reads:

# 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
ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500

Any help would be appreciated.

Thanks, Dan

wildteen88 March 13th, 2006 02:10 PM

I can tell you that Apache is using the error instructions you have set in httpd.comf file, but the reason why your custom error messages aren't working is because IE has a setting called "Show friendly HTTP error messages" enabled. This is what is stopping your custom error messages appearing.

To disable this setting simply open IE and go to Tools -> Options -> Advanced Tab and scroll down the Settings list untill you come to "Show friendly HTTP error messages" now just detick the tickbox next to it. Now just click Ok! Your custom error messages should now be showing.

Hope this helps.

d2nash June 17th, 2006 05:24 AM

Thanks - that works. Does that mean that in a live environment users will only see custom error messages if they have "Show friendly HTTP error messages" turned off in their browser? That seems to be a very unreliable way to ensure that users see custom error messages.

wildteen88 June 20th, 2006 11:25 AM

No this setting one effects localhost. If your site was live it will show the error message you define.

All times are GMT -4. The time now is 04:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.