there is a way to intercept an HTML DOM using an apache module and alter it with PHP?
The purpose is apply a set of PHP rules on all websites hosted on server (for example, replacing some strings).
SOLVED
I will update later with the solution
there is a way to intercept an HTML DOM using an apache module and alter it with PHP?
The purpose is apply a set of PHP rules on all websites hosted on server (for example, replacing some strings).
I will update later with the solution
you could try using the htaccess (possibly set-able server wide in apache conf) value:
php_value auto_prepend_file
I've used that before for handling any errors php throws, so with a little hacking you could have it prepend a script that buffers content and modifies it, I'm not sure how foolproof you can make it though.
This certainly is possible, different approaches exist.
Here an example of what I do to add a js tracking snippet to pages: http://blog.christian-reiner.info/2013/01/23/piwik/ The basic steps I use in there are: server side inclides (SSI) and substitution of closing body tags in all delivered html pages by preceding it with a small javascript. That javascript is generated by means of php. So a small php script is called automatically by the apache http server right before sending any html page to a client to add this small script.
Other good starting point certainly is apaches mod_ext_filter
: http://httpd.apache.org/docs/current/mod/mod_ext_filter.html