Log in

View Full Version : htaccess file active only on specific time range



Marquis
03-23-2014, 12:35 PM
Hi, hope someone can help me:

I have a htaccess protected password protected directory with

AuthType Basic
AuthName "Password"
AuthUserFile "/home/....."
require valid-user

My Question: Is it possible to make a htaccess with password protection which is active only on specific time range?

If anyone knows ..
thanks

kred
05-20-2014, 05:47 PM
I think that you should add the "expr" provider allowing to base authorization decisions on arbitrary expressions. For example this should activate password protection between 8am and 6pm:

Require expr %{TIME_HOUR} -ge 8 && %{TIME_HOUR} -le 18