• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Apache Time based rewrite

Below is the example to Deny access to a folder based on the Time

RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0600
RewriteCond   %{TIME_HOUR}%{TIME_MIN} <2400
RewriteRule ^.*$ - [F,L]  # Then deny all access

However, what I need now is to  to allow access to a folder based on the Time.
Please help !!

0
sixstrings
Asked:
sixstrings
1 Solution
 
giltjrCommented:
What time is the time period?

Why not just setup deny for the time period you do not want to allow them access?
0
 
ravenplCommented:
Try

RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0600
RewriteCond   %{TIME_HOUR}%{TIME_MIN} <2400
RewriteRule .* - [S=1]  # skip next rule processing
RewriteRule .* - [F,L]
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now