logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Can I return an error code when an Apache SSI fails?
Author
kramer2718



Joined: 20 Aug 2018
Posts: 1
Location: St. Louis, MO

PostPosted: Mon 20 Aug '18 17:54    Post subject: Can I return an error code when an Apache SSI fails? Reply with quote

Running Apache 2.2.15 on Linux 2.6.32.

I have a web application that uses Apache includes. Something like this:

Code:
<!--#include virtual="/some/application/component" -->


Now when /some/application/component fails, Apache still returns the rest of the page with missing output. I can set the errmsg config in order to display a specific error but the page itself is still returning a 200 response code. Is there a way that I can set the HTTP response code on the parent page (to 500) in the case of an SSI failure? Or set a custom HTTP header might work too.

Failing that, is there another way I can manage proper error handling in the case of an SSI failure?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 21 Aug '18 10:30    Post subject: Reply with quote

AFAIK virtual includes files, not urls. Is that a file that you try to include?
Did you add your file extension with AddOutputFilter ?

See https://httpd.apache.org/docs/2.2/howto/ssi.html
Back to top


Reply to topic   Topic: Can I return an error code when an Apache SSI fails? View previous topic :: View next topic
Post new topic   Forum Index -> Apache