views:

32

answers:

3

I have a demo server where I put samples of my apps, I send potential customers links to those apps. Is it possible to use htaccess to track visitors, without adding tracking capability to the apps themselves? The data I'm interested in are:

  1. date and time of page visit
  2. ip of visitor
  3. url of the page visited
  4. referrer
  5. post and get (query string) data if any
A: 

Best way it to use google analytics.
You will get all what you need and much much more.

darko petreski
Thanks, but I'm more interested in a solution where I don't need to alter the projects' code. With GA I'd have to add the js reference to my code.
Majid
+1  A: 

no, that's impossible to use .htaccess file, because it's merely a configuration file, not executable one.

However you can use another web-server capability - log files.
Everything you asking for is already stored in the access log, almost in the same format you listed here.

An important note: unlike google analytics or any other third-party or scripting solution, web-server logs is the only reliable and exact source of tracking data, contains very request been made to your site.

Col. Shrapnel
Thank you. That means I have old data too, excellent!
Majid
@Majid not too much data. Logs usually being rotated, leaving you last week or month data only.
Col. Shrapnel
A: 

That entirely depends on your webserver, what options it provides for htaccess overwrites.

For Apache, the access log logs what you are looking for http://httpd.apache.org/docs/current/logs.html#accesslog but is not configurable via htaccess.

Kissaki