Forum Moderators: phranque
AddType application/x-httpd-php .png
ErrorDocument 404 /path/hello.html
I put it in my apache 2.x at home and I get a "hello", and I put it in the web server apache 1.3.37 and I also get a "hello", however the URL on the browser changes to http://www.example.com/path/hello.html, while apache 2.x does not.
I know this shouldn't be important, but I'm trying to make a directory where you put an unexisting file name (in example, roses_are_red.png) and apache redirects you to a php file which generates a png file with the text "roses_are_red". It works in my 2.x but it fails in 1.3.37 with an "file.png not found , Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
I think that the 'url change' could be the reason of the problem (although I'm not sure of it) or give me a clue to what's happenning there.
Thanks in advance!
Kak
p.s. If there's an easier/better way to do what I'm trying to do, I'd also be interested in it!
[edited by: Kak2 at 9:42 am (utc) on April 10, 2009]
It *is* important, and you should find out why this is happening. Examine yur server *error* log file.
You should also never use a 404 page as a "redirector" unless you want to return a 404 error response.
And you must also examine the HTTP_ACCEPT header to be sure the client can accept .png files (MIME-type image/png) before sending a .png -- Not all clients can accept this filetype.
I would advise studying the underlying requirements to complying with the HTTP protocol and maintaining browser compatibility before continuing with your plans.
Jim