httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@nueva.pvt.k12.ca.us>
Subject Re: No HOST header solutions?
Date Wed, 29 May 1996 21:15:55 GMT
On Wed, 29 May 1996, Robert S. Thau wrote:

> The idea basically is to give each page two names, one of which is
> unique server-wide and can therefore be used even by old browsers.
> Unfortunately, this has a whole bunch of nasty consequences --- for
> one, it's likely that crawlers that aren't savvy to what's going on
> (which is probably most, given that the protocol doesn't presently
> give them sufficient information to figure it out without a whole lot
> of back-end inference) will wind up indexing every single page twice,
> once under each name.

Possibly true. But then, even without all this, I often end up with
the same page two or three times when I do a search... mirrors do the
exact smae thing.

> Another bit of nastiness is that you've got to be very careful to use
> relative URIs for *everything*, or nasty errors start creeping in.

Not neccessarily. See below:

> (Of course, if you arrange things so that those prefixes are present
> and required even if you *supply* the Host: header, and do a redirect
> to http://virtualhost.com/virtualhost if a direct request for
> http://virtualhost.com/ itself comes in, then both problems go away).

Actually... note that, due to the way mod_alias works, Aliases are
passed on to virtual hosts, unless overrided. So look at the solution I
propose:

Alias /apache /usr/web/apache
<VirtualHost www.apache.org>
ServerName www.apache.org
DocumentRoot /usr/web/apache
</VirtualHost>

What this means is that, predictably, a file at
/usr/web/apache/foo.html can be accessed as
http://www.apache.org/foo.html if the browser sends a Host: header,
but can be accessed with http://www.apache.org/apache/foo.html
regardless of whether or not it does send it, because the Alias
applies to both the main and "virtual" hosts.

So as long as you make sure to use
http://www.apache.org/apache/foo.html and not
http://www.apache.org/foo.html, you can use all the non-relative links
you want.

> Hmmm... in search of a simple answer...

There isn't one. The best I can come up with is to go back in time
to five years ago and convince whomever designed the HTTP 1.0 spec
that they should require full URLs in all requests. That seems to be
the most elegant solution.

-- 
________________________________________________________________________
Alexei Kosut <akosut@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/
 
      "War does not determine who is right, only who is left."


Mime
View raw message