You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Denise Mangano <De...@complusdata.com> on 2003/05/30 17:03:49 UTC

RE: [users@httpd] Redirect during certain time frame - SOLVED

Well after toying with the problem it turns out the my regular expression
was wrong, and I only needed one of the conditions.  So FYI the following
code worked:

   RewriteEngine on
   RewriteCond   %{TIME_HOUR}%{TIME_MIN} <0200
   RewriteRule   ^\/index\.html$     /maintenance.html


Thanks anyway :)
Denise 


-----Original Message-----
From: Denise Mangano [mailto:DeniseM@complusdata.com] 
Sent: Thursday, May 29, 2003 2:38 PM
To: 'users@httpd.apache.org'
Subject: RE: [users@httpd] Redirect during certain time frame


I'm trying to work out the rewrite between 12 am and 2 am, but it does not
seem to be working.  I entered the following code within my virtual host
directive:

   RewriteEngine on
   RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0200
   RewriteCond   %{TIME_HOUR}%{TIME_MIN} <2400
   RewriteRule   ^index\.html$     index.html
   RewriteRule   ^index\.html$     maintenance.html


So during the hours of 2am and 12 am requests to www.mysite.com will get
served the index.html page.  In my httpd.conf the default file to serve for
requests to www.mysite.com is index.html.  To test I changed this to:

   RewriteEngine on
   RewriteCond   %{TIME_HOUR}%{TIME_MIN} >2400
   RewriteCond   %{TIME_HOUR}%{TIME_MIN} <0200
   RewriteRule   ^index\.html$     index.html
   RewriteRule   ^index\.html$     maintenance.html

This should mean that any request during the hours 2am and 12am get served
maintenance.html.  However when I visit www.mysite.com index.html is always
getting served.

Any advice?  Thanks.


Denise Mangano
Help Desk Analyst
Complus Data Innovations, Inc.
 


-----Original Message-----
From: WC -Sx- Jones [mailto:lists@insecurity.org] 
Sent: Wednesday, May 28, 2003 9:18 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Redirect during certain time frame



On Wednesday, May 28, 2003, at 09:15  AM, Denise Mangano wrote:

> index pages from multiple directories - but I guess a crash course is 
> in order.


Use Perl - then write out .htaccess files for those directories -- it 
will save a LOT of time.

Cheers/Sx

http://InSecurity.org/
_Sx____________________
  ('>    iudicium ferat
  //\   Have Computer -
  v_/_    Will Hack...

               \|/ ____ \|/
               "@'/ .. \`@"
               /_| \__/ |_\
                  \__U_/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org