Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Wondering if there are any good ideas on how to make a feature to limit site visits (per month). It is for an app that uses client-based subdomains, or "wildcards". My initial thoughts are that the visit-count logic will have to be within PHP. I am thinking once a limit is hit (for the month), a config file is overwritten for Apache, disallowing anymore traffic to the particular subdomain. This way, any type of extreme traffic basically bounces off the server, instead of getting to the app itself, and initiating any of the logic/SQL queries.

I would anticipate a cron would reset the Apache file, and the view counts in the database. What do you think for a simple count limiter? Any other ideas? Thank you!

share|improve this question

migrated from May 17 '11 at 16:48

This question came from our site for professional and enthusiast programmers.

I woudn't complicate this with modifying apache config files. If you put the check at the beginning of your code things should work fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.