Forum Moderators: phranque

Message Too Old, No Replies

Pre-processing HTML sent by Apache

         

u2ill

5:33 pm on Aug 6, 2008 (gmt 0)

10+ Year Member



I'm not sure exactly how to phrase this question so I'll do my best.

I was wondering if anybody knew of a program that would "pre-process" the output that Apache sends to the browser. So for example, let's say Apache is calling a PHP file. The call is made, and the PHP processor does it's thing and returns it's output to Apache. Apache then in turn outputs what it gets from PHP to the browser. I'd like to be able to process the output AFTER PHP is done with the code, but BEFORE Apache sends it to the browser.

I mainly want to be able to do REGEX modifications on the source just before it's sent to the browser. I want our web authors to be able to put in normal standards compliant HTML, and then I want to alter their "normal" HTML based on a set of REGEX expressions.

Does anyone know if this is possible?

u2ill

5:55 pm on Aug 6, 2008 (gmt 0)

10+ Year Member



I found the answer to my question, and in the process I realized I should have been asking a different question! But for future reference, to do what I had originally asked, Apache's mod_substitution should do the trick.

The REAL question I should have been asking was how to do this in PHP - how to do a REGEX substitution on the PHP source BEFORE PHP processes it. I'll ask that one in the PHP forum.