I have this setup in the .htaccess file:
Code:
<Directory "/var/www/html/res">
AuthType Basic
AuthName "Restricted"
AuthUserFile /pts/htaccess/.pas
AuthGroupFile /dev/null
require valid-user
Options -Indexes
ErrorDocument 400 /html_errors/index.html
ErrorDocument 401 /html_errors/index.html
ErrorDocument 403 /html_errors/index.html
ErrorDocument 404 /html_errors/index.html
RewriteEngine On
RewriteCond %{TIME_HOUR} ^01|04|08|16|17$
RewriteRule ^.*$ - [F,L]
Order deny,allow
Deny from all
Allow from 192.168.2.100
</Directory>
The only thing that does NOT work is the hour of day restriction section.
Code:
RewriteEngine On
RewriteCond %{TIME_HOUR} ^01|04|08|16|17$
RewriteRule ^.*$ - [F,L]
I want to make sure that access is allowed during 1am, 4am, 8am, 4pm and 5pm.
But this does not work during any time.
I tested it at 1:10am, 1:30am, 4:05am
I keep getting a "HTTP Error 403 - Forbidden"
My ip address is 192.168.2.100
And my id and password are being accepted.
If I remove the 3 Rewrite lines, then everything works fine.
What did I do wrong?