add Mint to track image (resizes and full sizes)

CX7

Joined: 2011-01-05
Posts: 7
Posted: Thu, 2011-03-31 13:19

Hi all

I want to implement my Mint stats download tracker for all requests concerning resizing and full size viewing/downloading (not thumbnails).

currently I use the script to track visitors but I want to see bandwidth and popularity too.

Here are a few options:

Example 1: Redirect all file requests in this directory and subdirectories, if the requested file exists.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ http://minteddomain.com/mint/pepper/tillkruess/downloads/tracker.php?url=http://%{HTTP_HOST}%{REQUEST_URI}&force

Example 2: Redirect only file requests that end with .zip, .rar or .tar.gz in this directory and subdirectories, if the requested file exists.
<FilesMatch "\.(zip|rar|tar\.gz)$">
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ http://minteddomain.com/mint/pepper/tillkruess/downloads/tracker.php?url=http://%{HTTP_HOST}%{REQUEST_URI}&force
</FilesMatch>

Example 3: Redirect file requests in this directory and sub-directories that end with .mp3 or .pdf, and “display” them inline.
<FilesMatch "\.(mp3|pdf)$">
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ http://minteddomain.com/mint/pepper/tillkruess/downloads/tracker.php?url=http://%{HTTP_HOST}%{REQUEST_URI}&force&inline
</FilesMatch>

Note: Use the &force parameter to avoid an infinite loop.
Note: Use the &inline parameter to set the Content-Disposition from attachment to inline.

Furthermore:

Example: http://minteddomain.com/mint/pepper/tillkruess/downloads/tracker.php?url=http://minteddomain.com/archive.zip
If you want to track files that are not on your local server, or your Mint installation is on a subdomain use the &remote query command.
Example: http://mint.domain.com/pepper/tillkruess/downloads/tracker.php?url=http://domain.com/archive.zip&remote
Example: http://minteddomain.com/mint/pepper/tillkruess/downloads/tracker.php?url=http://anotherdomain.com/archive.zip&remote

---

I've tried to use .htaccess within the re-sizes gallery dir and the albums gallery dir. however it doesn't want to track. I'm watching the URL's and it is not going through the extra rewrite parameter.
Also I had a look at the JS stuff but I don't know anything about JS so couldn't grasp where I could fiddle.

Any ideas?

Thanks!

 
CX7

Joined: 2011-01-05
Posts: 7
Posted: Fri, 2011-04-01 12:48

hi all

I've had a bit more of a play with this. I think htaccess maybe the best way to go to for a rewrite on the file url being requested.

I can't seem to get the REQUEST_URI or REQUEST_FILE to pass the correct location. I can see it is going through the script but no images load and the script is not taking it as a hit because of this.

Any thoughts?

Thank you