httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denise Mangano <Deni...@complusdata.com>
Subject RE: [users@httpd] Redirect during certain time frame
Date Wed, 28 May 2003 13:15:47 GMT
Thanks for the response.  I actually found that guide and saw the example a
few minutes after I posted.  I figured rewrite would be the way to do this
but I was trying to see if there was any other way.  I'm pressed for time,
and not familiar with the expressions and I have to do this for multiple
index pages from multiple directories - but I guess a crash course is in
order.

Thanks :)

Denise 
 


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



On Wednesday, May 28, 2003, at 12:40  AM, Denise Mangano wrote:

> Is it possible to redirect all incoming requests to a particular page
> on my
> server during a specific time frame?


See
http://httpd.apache.org/docs/misc/rewriteguide.html

(And yes, these rewrite rules work the same for Apache2.x as well...)

Example:
Time-Dependend Rewriting

Description:
     When tricks like time-dependend content should happen a lot of 
webmasters still use CGI scripts which do for instance redirects to 
specialized pages. How can it be done via mod_rewrite?

Solution:
     There are a lot of variables named TIME_xxx for rewrite conditions. 
In conjunction with the special lexicographic comparison patterns 
<STRING, >STRING and =STRING we can do time-dependend redirects:

RewriteEngine on
RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0700
RewriteCond   %{TIME_HOUR}%{TIME_MIN} <1900
RewriteRule   ^foo\.html$             foo.day.html
RewriteRule   ^foo\.html$             foo.night.html

     This provides the content of foo.day.html under the URL foo.html 
from 07:00-19:00 and at the remaining time the contents of 
foo.night.html. Just a nice feature for a homepage...


HTH/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


Mime
View raw message