httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean Bonnot <>
Subject Re: [users@httpd] access control based on time of day
Date Sun, 29 Jan 2006 08:50:08 GMT
McDouglas a écrit :

>I have some trouble figuring out how to set up apache to allow remote users
>to request pages only at a given time of day.
>I've read the documentations of mod_access and mod_auth, but could not find
>any information.
>"Access can be granted or denied based on a wide variety of criteria, such
>as the network address of the client, the TIME OF DAY, the phase of the
>moon, or the browser which the visitor is using."
>After reading this, I hoped it is possible to do. Any ideas?
with a little shell script it would be easy :


hour=`date +"%H"`

if [ $hour < 09 -a $hour > 18 ]; then
# this is not the good time
cat << __eof__
Location: /redirect/to/goaway/page.html

# notice the empty line after the "location:" !!!
# This guy is in the good time-slice
cat /where-the-good-web-page-is/thepage.html

# Don't use a "location:" to redirect the user to the good page !

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message