There are a few ways to remove the analytics code and in a few degrees.
You can completely shut it down, you can shut it down for certain filetypes, you can shut it down for certain files (where you don't want the injection to take place).
Shutting it down completely can be achieved trough the control panel:
http://members.000webhost.com/analytics.php
Shutting it down trough the .htaccess file can be achieved by adding this line to your .htaccess file:
Code:
php_value auto_append_file none
Save and reupload to your server and the analytics code is not injected anymore.
Allowing the injection to take place on certain file extensions only can be achieved trough adding and altering this code to your needs:
First some examples to protect .extension groups like .htm(l) or .php etc.
The link to the Analytics counter I found trough looking at the source of a injected html file so this should be accurate.
If one is to add this to the .htaccess you inject only into html files in the directory where you place this .htaccess:
And if you want it to affect php files, change the first line to this:
Code:
<FilesMatch "\.(php)$">
This you can do for each .extension, or even add a few extensions in the same line like:
Code:
<FilesMatch "\.(php|html|htm)$">
If you only want to protect certain specific files from being injected you can use the following code (which I use myself for a security script that cannot be injected because it corrupts that script):
Code:
<Files the_file_you_want_protected.php>
php_value auto_append_file none
</Files>
Ofcourse you will have to rename "the_file_you_want_protected.php" to whichever file it really is that you want protected including it's extension.
It would effectively protect that file from being injected while leave the rest of the site alone and have Analytics have it's way on the site.
This is from my own trial and errors. You can find my original post here:
[Wordpress] Website Defender Plugin Problems
Good luck, Mike.
Edit, My 100th post yay :P