You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Csaba Gabor <cs...@yahoo.com> on 2001/12/11 07:21:09 UTC

Location box values and domain resolution

Hi,

    I have Apache 2.0.28 on Win2K without virtual domains, and I'm experiencing some behaviour
that I don't understand.  I hope someone can provide appropriate commentary.

I have two domains at gandi.net, both with redirection (gandi creates pages at redir.gandi.net
which point to my server at the redirection site).
MainDomain.com -> http://64.0.57.165
SubDomain.com -> http://64.0.57.165/Sub1

My questions are
(1)  How is what goes into the location box of Netscape (or IE) determined?  And can I affect
it?
(2)  Does the following behaviour seem reasonable?
(3)  Can I supress steps C, D and E?

I put SubDomain.com into the location box and hit enter.
(A)  Netscape runs out to redir.gandi.net and comes back with a response of 302 Found and
Location: http://64.0.57.165/Sub1 which is what I would expect.
(B)  So then my server (with ServerName MainDomain.com) gets queried and instead of handing back
the index.htm file it has in the Sub1 directory, it hands back a response of 301 Moved
Permanently and Location: http://MainDomain.com/Sub1/
(C)  So now we go running back to redir.gandi.net to get a response of 302 Found and Location:
http://64.0.57.165/Sub1/ which is obtained from the redirection from MainDomain.com concatenated
with Sub1.
(D)  Now my server finally responds with 200 OK and returns the Sub1/index.htm page but no
Location header
(E)  However, even if I explicitely set the Location header in step D to
http://www.SubDomain.com it is ignored and the browser's location box shows
http://64.0.57.165/Sub1/

Comment.  Apache has verified that the domain is consistent.  Why won't it display the domain
name in the box?  And shouldn't I be able to somehow override it with the original request that
started out the whole process?  If so, how do I do it?
        Thanks,
              Csaba

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

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


Re: Location box values and domain resolution

Posted by Owen Boyle <ob...@bourse.ch>.
Csaba Gabor wrote:
> 
> Hi,
> 
>     I have Apache 2.0.28 on Win2K without virtual domains, and I'm experiencing some behaviour
> that I don't understand.  I hope someone can provide appropriate commentary.
> 
> I have two domains at gandi.net, both with redirection (gandi creates pages at redir.gandi.net
> which point to my server at the redirection site).
> MainDomain.com -> http://64.0.57.165
> SubDomain.com -> http://64.0.57.165/Sub1
> ....various redirection troubles.

I didn't take the time to study your message in detail (it is quite
complicated) but I think the problem will be clearer (and may even go
away!) if you use a trailing slash at the end of your re-directs, i.e.

MainDomain.com -> http://64.0.57.165/
SubDomain.com  -> http://64.0.57.165/Sub1/

At the moment, you are forcing a re-direct to a location without a
trailing slash. This causes apache to issue another redirect (with the
trailing slash) using the ServerName argument - which may not be what
you want. This could be why you're getting into a loop. 

The trailing slash is quite important and is not just an optional
nicety. The fact that apache works at all without it should be a cause
of wonderment rather than taken for granted :-)

Rgds,

Owen Boyle.

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