Forum Moderators: phranque

Message Too Old, No Replies

Custom 'Page not Found' 404 not working with .php links

         

Yamaha_R1

3:30 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



I wanted to make a custom 'Page Not Found' for our site that is more user friendly, and doesn't make our site look broken.

So I made a custom page, 'nopage.php'.

Then I created an .htaccess file, redirecting 404 errors to 'nopage.php'.

Heres what happened.

If you enter in a bogus path or .htm, html extension, it works great! Hurray.

BUT, if you enter .php extension, or your link is to a missing .php file, I get 'Internal Server Error' page.

My guess is that PHP is returning an error, instead of page not found.

Now, I can't add 500 to 'nopage.php', because then everytime there IS an internal server error, it will report it incorrectly and just say 'nopage.php'.

So how do I create a 'nopage.php' that handles a missing PHP file?

Yamaha_R1

8:13 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



I found it.

PHP bug number 14409. I guess it has been fixed in the later versions, but my web host is still running version 4.0. When asked when they plan to update, they said end of summer.

I guess for now I can use 'nopage' for both 400 and 500, as a workaround.

Bummer.