httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert L. Harris" <Robert.L.Har...@rdlg.net>
Subject Re: Rewriting a URL
Date Fri, 11 Jan 2002 17:13:22 GMT


Ok, This looks good for the incoming stream.  I can see where it's trying to match:
10.10.117.230 - - [11/Jan/2002:17:04:12 -0700] [site1.company/sid#80b7788][rid#80cd320/initial]
(2) init rewrite engine with requested uri /site
10.10.117.230 - - [11/Jan/2002:17:04:12 -0700] [site1.company/sid#80b7788][rid#80cd320/initial]
(3) applying pattern '(.*)' to uri '/site'
10.10.117.230 - - [11/Jan/2002:17:04:12 -0700] [site1.company/sid#80b7788][rid#80cd320/initial]
(4) RewriteCond: input='site1' pattern='gonzo1.company.com' => not-matched
10.10.117.230 - - [11/Jan/2002:17:04:12 -0700] [site1.company.com/sid#80b7788][rid#80cd320/initial]
(1) pass through /site

It's seeing the intcoming request going to site1.company.com.  My redirect rule
kicks in pointing the request to go to gonzo1.company.com and it servers up
the data nicely.  The problem is that when the data is done loading and I look
at the URL returned, it's still pointing to gonzo.  The outbound url is not
being rewritten.  My URL returned after the page load is:

http://gonzo1.company.com/somegarbage.html  

  and it needs to be
 
http://site1.company.com/somegarbage.html




Thus spake Joshua Slive (joshua@slive.ca):

> 
> > From: Robert L. Harris [mailto:Robert.L.Harris@rdlg.net]
> 
> >     RewriteRule ^.*gonzo.*company.com/(.*)
> > http://site1.company.com/$1 [L,R]
> >
> >
> > The theory would be to rewrite any outbound instance of "gonzo1"
> > to "site1"
> > for the hostname.  I found the logging directive and see this in my logs:
> 
> > The first problem is that the url it's reading doesn't seem to have the
> > hostname.  Ummm, that's not a good thing.
> 
> That's right.  RewriteRule matches only on the part of the URL following the
> hostname and port.  What you want is something like (untested):
> 
> RewriteCond %{HTTP_HOST} gonzo.*company.com [NC]
> RewriteRule (.*) http://site1.company.com/$1 [L,R]
> 
> Joshua.
> 
> 
> ---------------------------------------------------------------------
> 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
> For additional commands, e-mail: users-help@httpd.apache.org



:wq!
---------------------------------------------------------------------------
Robert L. Harris                |  Micros~1 :  
Senior System Engineer          |    For when quality, reliability 
  at RnD Consulting             |      and security just aren't
                                \_       that important!
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.
FYI:
 perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message