Re: redirector: are http headers available?

From: Graham Toal <gtoal@dont-contact.us>
Date: Wed, 7 May 1997 16:34:38 -0500 (CDT)

I said:

> > I don't see any way of getting at the other HTTP headers. They're
> > not in the environment - I got the redirector to print it out.
> >
> > What I want to do is intercept "Host:" headers, and rewrite the URLs
> > to go elsewhere (like demon are doing - so that www.pizzabox.vt.com/
> > is mapped to www.vt.com/~pizzabox/, for example)

You said:

> The redirector in Squid only translates the requesting URL to another URL..
> I used the next perl script for changing references from one interface to
> another..

> s@http://search.nic.surfnet.nl@http://search-eth.nic.surfnet.nl@;

I understand how to rewrite a URL; that's not the problem. The problem
is that is I have a server with one IP address, and a CNAME that points to
that IP address, a request for /index.html on the main name and a
request for /index.html on the alternative name both appear identical
in the information passed to the redirector program. However, they are
not identical, because the browser includes the original host name in
a new "Host:" header which is passed in with the GET request (at least
95% of the time, according to jrg :-) )

Many commercial web servers are now using this header to offer cheap
virtual hosting while conserving IP addresses. We would like to use it this
way too, to give our 2000 customers the appearance of their own web
site (eg www.pizzabox.vt.com/) when in reality the page the browser
fetches is www.vt.com/~pizzabox.

Make sense now?

So what I need is the redirector program to have the rest of the
http header info available to it, to use in the rewriting process.
It may be that it simply isn't supported at the moment, in which case
I have some hacking to do to the redirector interface :-(

G
Received on Wed May 07 1997 - 14:32:46 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:35:08 MST