Question

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
Was it helpful?

Solution

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

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.

OTHER TIPS

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.

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

I know this thread has been quiet for a while, but i it not possible to use the prepend?? directive that prepends a script to all visits to track site/page visits ?

I have not got the code (tried something similarthough was not successfull) but I used the prepend directive to prepend a script that "switches" on gzip for all site visits. I am sure the same can be implemented for logs (for those of us with cheap shared servers!) Come on coders, do us all a favour and reveal the secret!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top