On 3/18/21 3:06 AM, Jens Kallup wrote:
> Hello,
> how can I time based open times?
> The script below seems not work.
> All pages are the same.
>
> RewriteEngine On
> LogLevel warn rewrite:trace3
What does the trace log say when you make the request?
>
> # ---------------------------------------------------------
> # compress file(.ext) on server side, beofre delivery ...
> # on MS-Windows; you should have the GNU-Tools installed !
> # ---------------------------------------------------------
> RewriteCond %{HTTP:Accept-encoding} gzip
> RewriteCond %{REQUEST_FILENAME}\.gz -s
> RewriteRule ^(.*)\.(css|js|txt) $1\.$2\.gz [QSA]
>
> # ---------------------------------------------------------
> # shortners ...
> # ---------------------------------------------------------
> Alias "/pub" "${APACHE_WEB}/443/pub"
> Alias "/edu" "${APACHE_WEB}/443/edu"
>
> # store variable values with dummy rewrite rules
> RewriteRule . - [E=req_scheme:%{REQUEST_SCHEME}]
> RewriteRule . - [E=http_host:%{HTTP_HOST}]
> RewriteRule . - [E=req_uri:%{REQUEST_URI}]
>
> # ---------------------------------------------------------
> # out of office time rule ...
> # from 07:00 - 20:00
> # ---------------------------------------------------------
> RewriteCond %{TIME_HOUR} >=09 [OR]
> RewriteCond %{TIME_HOUR} <=10
> RewriteRule /pub/.* - [E=HTTP_OFFICE_HEADER:1]
> RewriteRule /pub/.* - [E=HTTP_OFFICE_HEADER:0]
> RewriteRule ^$ /pub/.* [R=301,L]
>
>
> In PHP:
>
> <?php
> $office = $_SERVER['HTTP_OFFICE_HEADER'];
> $status = 0;
>
> if (strcmp($office,"0") == 0)
> $status = 0; else
> $status = 1;
> ?>
>
> Jens
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
--
Rich Bowen - rbowen@xxxxxxxxxxx
@rbowen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx