RE: [users@httpd] Unable to redirect ( using mod_rewrite)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Oliver,

Great! Thanks for pointing the problem.

I have added line as per your suggestion ( with slight change : addition of slash at start! ) as follows :

RewriteCond   %{REQUEST_URI}  !^/downtime\.html$

And it's working............

Cheers,
Rajendra

 

-----Original Message-----
From: Oliver.Schaudt@xxxxxxxxx [mailto:Oliver.Schaudt@xxxxxxxxx] 
Sent: Tuesday, December 27, 2005 2:52 PM
To: users@xxxxxxxxxxxxxxxx
Subject: AW: [users@httpd] Unable to redirect ( using mod_rewrite)

Hi Rajendra,

there is the line "RewriteCond   %{REQUEST_URI} !^downtime\.html$"
missing, because if you can to redirect all URL's to "downtime.html", but you have to exclude the "downtime.html" itself. If not, this will result in an infinte loop. 

So your new Block will be

RewriteCond   %{REQUEST_URI}  !^downtime\.html$
RewriteCond   %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} >21700
RewriteCond   %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} <21759
RewriteRule   /.*  http://<webstite>/downtime\.html
<http://<webstite>/downtime\.html>  [R,L]
RewriteRule   ^/$  /confluence/  [R]


bye

Oliver


-----Ursprüngliche Nachricht-----
Von: Rajendra Kadam -X (rakadam - eTouch Systems at Cisco) [mailto:rakadam@xxxxxxxxx]
Gesendet: Di 27.12.2005 23:20
An: Apache-HTTPD  Users Mailing list
Betreff: [users@httpd] Unable to redirect ( using mod_rewrite)
 
Hi Folks,
 
I want to do time based rewrite in order to display a Downtime page during DATABASE maintenance.
 
Htpd.conf has following settings

RewriteEngine on
RewriteLog      logs/rewriteLog.log
RewriteLogLevel 9
 
RewriteCond   %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} >21700
RewriteCond   %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} <21759
RewriteRule   /.*  http://<webstite>/downtime\.html
<http://<webstite>/downtime\.html>  [R,L]
RewriteRule   ^/$  /confluence/  [R]

It means on every Sautrday between 2am-3am, any url pointing to our website should get directed Downtime page. In all other cases, next Rewrite rule should work!
 
But whenever I tried to test it; Firefox always fails with following error :
------------------------------------------------------------------------
----------------------------
 
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    *   This problem can sometimes be caused by disabling or refusing to
accept
          cookies.
 
Here is Rewrite_Log:
 
171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (2) init rewrite engine with requested uri /confluence/display/WIKI/Home 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (3) applying pattern '/.*'
to uri '/confluence/display/WIKI/Home'
171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (4) RewriteCond:
input='21710' pattern='>21700' => matched 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (4) RewriteCond:
input='21710' pattern='<21759' => matched 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (2) rewrite /confluence/display/WIKI/Home -> http://wiki-dev/downtime.html 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (2) explicitly forcing redirect with http://wiki-dev/downtime.html 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (1) escaping http://wiki-dev/downtime.html for redirect 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev/sid#9968800][rid#9a508f0/initial] (1) redirect to http://wiki-dev.com/downtime.html [REDIRECT/302] 171.71.57.50 - - [27/Dec/2005:17:10:50 --0500] [wiki-dev.cisco.com/sid#9968800][rid#9a508f0/initial] (2) init rewrite engine with requested uri /downtime.html

I'm not sure what's wrong going on here...
Can anybody please help,
 
thanks,
Rajendra

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux