Page 1 of 1

Using SSI in error404.html

Posted: Fri Jun 01, 2007 9:09 am
by ian rush
Hi there,

I'ma proper novice with php, hope this question isnt too daft. I'm trying to include header, footer and some generic content to an error404.html file. I can get the file working just fine if i directly reference it as a url, but when the server calls the file as result of a mis-spelt url with .php file extension it does not parse the php in error404.html, & directly outputs the file with the php as html source code.

Is there any fix for this problem at all??

thanks in advance folks,

ian

Posted: Fri Jun 01, 2007 9:22 am
by superdezign
Sounds to me like you have a hosting provider that handles your 404 rewrite for you.

In that case, it's probably just the fact that you use an HTML file. Try making an error404.php.

Posted: Fri Jun 01, 2007 9:25 am
by feyd
An article: http://www.phpfreaks.com/tutorials/21/0.php
More information on the configuration changes needed: http://httpd.apache.org/docs/1.3/custom-error.html

Posted: Fri Jun 01, 2007 9:33 am
by ian rush
In that case, it's probably just the fact that you use an HTML file. Try making an error404.php.
thanks for the response -- I guess i didnt really explain my problem thoroughly enough, so i'll have another crack, hope this makes a bit more sense?

when i set up a 404.php error page, it only worked if I have an incorrect url without a .php extension (like http://www.abc/), if the incorrect url does have .php extension (http://www.abc.php), then the error404.php file is not returned, instead the hosting companys own 404 page shows.

My hosting people (1&1) say that this is why i should use error404.html page which works for all incorrect urls, which leads to the problem that i'm having with php not parsing.

any ideas at all?

Posted: Fri Jun 01, 2007 9:44 am
by superdezign
Sounds like an error on their part. Tell them to make it work.

Posted: Fri Jun 01, 2007 10:33 am
by ian rush
oh ok cheers, I'll contact them. If anyone else has come across this problem before, do let me know!