I found a solution, that works for me...
The file with the prepared times in /var/spool/timing:
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0816
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1603
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0816
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1604
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0815
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1605
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0815
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1606
...
...
...
...
And the two files with the rest of the parts, also in /var/spool/timing .begin
Options -Indexes +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Language} ^.*en.*$ [NC]
RewriteRule ^index\.html$ /e/i/index.html [L]
RewriteCond %{HTTP:Accept-Language} ^.*de.*$ [NC]
and .end
RewriteRule ^index\.html$ /d/i/index.html [L]
RewriteRule ^index\.html$ /d/index.html [L]
RewriteCond %{HTTP:Accept-Language} ^.*en.*$ [NC]
RewriteCond %{TIME_HOUR} >17
RewriteCond %{TIME_HOUR} <06
RewriteRule ^index\.html$ /e/index.html [L]
The script daily takes the first two line and puts them into a new one. Then it combines all three files into the new .htaccess. In the end it cleans the files again.
#!/bin/sh
sed -n 1,2p /var/spool/timing/2014.txt >> /var/spool/timing/.mid
cat /var/spool/timing/.begin /var/spool/timing/.mid /var/spool/timing/.end >
/var/www/.htaccess
sed -i '1,2d' /var/spool/timing/.mid & sed -i '1,2d'
/var/spool/timing/2014.txt
so that in the end there is one new .htaccess every day:
Options -Indexes +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Language} ^.*en.*$ [NC]
RewriteRule ^index\.html$ /e/i/index.html [L]
RewriteCond %{HTTP:Accept-Language} ^.*de.*$ [NC]
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0816
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1603
RewriteRule ^index\.html$ /d/i/index.html [L]
RewriteRule ^index\.html$ /d/index.html [L]
RewriteCond %{HTTP:Accept-Language} ^.*en.*$ [NC]
RewriteCond %{TIME_HOUR} >17
RewriteCond %{TIME_HOUR} <06
RewriteRule ^index\.html$ /e/index.html [L]
It works nice so far, i just have to set up a new 2015.txt at the end of this year - if thats nacessary at all...I think i will take it every year again.