.htaccess deny access to folder between hours

This is how we can block access to a folder between 13 and 15 o’clock.

RewriteCond %{TIME_HOUR} ^(13|14|15)$
RewriteRule ^.*$ – [F,L]

The hours are based on 24 hours in a day from 0 to 23.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.