I'm trying to inject a tracking code to all the website files.. after googling for a while a found a tutorial to do it from .htaccess .. this is how it works
Options +Includes
AddHandler server-parsed .html
AddHandler application/x-httpd-php .html
php_value auto_prepend_file /var/www/to_include.php
php_value auto_append_file /var/www/to_include2.php
to_include.php
has a php ob_start()
to buffer the page contents and add my code to it, and to_include2.php
has the ob_end_flush()
that goes to the end of the page...
That's good till now, but it doesn't apply it to every single file ..
I'm not an htaccess expert but as you see the second and third line where it says
AddHandler server-parsed .html
AddHandler application/x-httpd-php .html
it says only apply it to .php and .html files, How can i use AddHandler
to handle all kind of files, including apache directories.. it has no extension but i also want some line that does it to every visited page on the website,
My target is to track all kind of moves on the website and inject google analytics to each file