开发者

Using htaccess to track visitors?

开发者 https://www.devze.com 2023-01-15 17:27 出处:网络
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 th

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 inter开发者_如何学Cested 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


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.


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号