Using SSI in error404.html

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
ian rush
Forum Newbie
Posts: 3
Joined: Fri Jun 01, 2007 8:52 am

Using SSI in error404.html

Post 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
Last edited by ian rush on Tue Jun 05, 2007 12:44 pm, edited 1 time in total.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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
ian rush
Forum Newbie
Posts: 3
Joined: Fri Jun 01, 2007 8:52 am

Post 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?
Last edited by ian rush on Tue Jun 05, 2007 12:45 pm, edited 1 time in total.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Sounds like an error on their part. Tell them to make it work.
ian rush
Forum Newbie
Posts: 3
Joined: Fri Jun 01, 2007 8:52 am

Post by ian rush »

oh ok cheers, I'll contact them. If anyone else has come across this problem before, do let me know!
Post Reply