0

I want to you Apache 2.2 httpd to SSI include URLs using

<!--#include virtual="/content/foo.html" -->

My problem is if, the SSI included page doesnt exist on my App server, it responds with a 404 response and a default error page HTML, which is then stitched into my page via the include. For failing (4xx,5xx) SSI includes I simply want the SSI include to add the empty string to my page.

It doesn't appear Apache 2.2. supports the 'onerror' directive (which I think would solve this) - and i dont see any other options.

http://httpd.apache.org/docs/2.2/mod/mod_include.html

empire29
  • 3,729
  • 6
  • 45
  • 71
  • Worked around issue by detecting SSI requests at the Application level and returned empty responses when a 4xx+ status code. – empire29 May 10 '14 at 16:07

1 Answers1

0

You could potentially add a rewrite to handle those portions of your application's URI space, but I'd advise against it. The approach being investigated seems to not fix the main problem: the concept of SSIs hinges on the files being included should be consistently available. If the included files are returning 4xx or 5xx class errors, the onus is on you to fix these errors.

Sasha
  • 485
  • 3
  • 6
  • httpd 2.4 mod_include seems to accept part of the onus via the introduction of the `onerror` attribute; unfortunately this is not available in 2.2. – empire29 May 10 '14 at 16:11
  • I still don't see why you're trying to handle SSI files not existing on disk. Are they out of scope for the web server config for this application? – Sasha May 13 '14 at 19:08