htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Deny access to a folder based on the Time
PostPosted: 03 Oct 2006 02:15 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
If for some reason you would like to block access to files in a directory during a specific time of day, you can do so by adding the following code to an .htaccess file.

Code:
RewriteEngine On
RewriteCond %{TIME_HOUR} ^16$    # If the hour is 16 (4 PM)
RewriteRule ^.*$ - [F,L]  # Then deny all access

RewriteCond %{TIME_HOUR} ^16|17|08$ # Multiple hour blocks, 4 or 5 or 8 AM


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB