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

[cobalt-developers] RE: [cobalt-users] Having to add / at end of URL to get index.html to show



Hi, Eric,

So the problem was a little more simple that I thougth, and you got 
it!... The UseCanonicalName directive, as you know, referrs to the 
way Apache constructs self-referring URL's. You ask what do you 
lose with this option? Well, not much, I beleive, but in some cases 
it can be not recommended.

Let's say you have a virtual site that can be reached as 
'www.yourdomain.com' and as 'yourdomain.com'. If 
UseCanonicalName is on and 'www.yourdomain.com' is the mail 
name for the virtual site, every time a client requests something 
like 'yourdomain.com/whatever' it will be redirected to 
'www.yourdomain.com/whatever', and the access will be logged like 
this, so when you look at the stats for your sites you will see the 
accesses to '/whatever' all together. But if UseCanonicalName is 
off, some accesses will be logged as 
'www.yourdomain.com/whatever', some other as 
'yourdomain.com/whatever' and, if it is the default site for your 
server, some other as 'your-ip-address/whatever'. This is not serius, 
but can make your stats less clear.

A more serius problem would be if you plan to use the environment 
variable 'HTTP_REFERER' to check where does your client come 
from or if you use cookies that only go back to the server that set 
them. In both cases you should be aware of that one or more 
different URL could actually refer to the same document.

Personally, I prefer to leave UseCanonicalName in the default value 
(on) and edit my HOST file if I need to access, for testing or 
administrative purposes, a virtual site that is not set up in the DNS 
servers.

I hope this helps you.

On 21 Jan 2001, at 0:45, Eric Arseneau wrote:

> Thank you Julio, I must say that this is the best explanation I have had of
> this problem.  Debbie did try, but I must of had my dunce cap on.
> 
> So I did a little test, I tried netscape.  Well Netscape came back with an
> error dialog saying that DNS could not resolve my server name, even though I
> did not use the server name in the request, I used the IP.
> 
> So I then went into my hosts file, for the fun of it, and added the entry
> for the server it was asking for.  And lo and behold, it WORKED.  So the
> problem is as you say.
> 
> The question that needs to be asked is this, why does the redirect ask for
> the server name, rather than the IP address specified in the original URL ?
> I assume that it gets the server name from my configuration of apache ?
> 
> I did another test, I took the canonical option in httpd.conf and turned it
> off, and everything is working fine, plus I get everything showing up the
> way you would expect, with or without the '/'.  I can still get access to my
> admin pages and everything else is ok.  So the question that begs to be
> asked is, what do I lose with this option ?
> 
> > -----Original Message-----
> > From: Julio López Garbayo (comercial) [mailto:comercial@xxxxxxxxxxxxxx]
> > Sent: Saturday, January 20, 2001 4:37 PM
> > To: cobalt-developers@xxxxxxxxxxxxxxx; eat@xxxxxxx
> > Subject: Re: cobalt-developers digest, Vol 1 #451 - 6 msgs
> >
> >
> > On 20 Jan 2001, at 12:03, cobalt-developers-request@xxxxxxxxxxxxxxx wrote:
> >
> > > Message: 6
> > > Reply-To: <eat@xxxxxxx>
> > > From: "Eric Arseneau" <eat@xxxxxxx>
> > > To: <cobalt-developers@xxxxxxxxxxxxxxx>
> > > Date: Sat, 20 Jan 2001 09:13:11 -0800
> > > Subject: [cobalt-developers] Having to add / at end of URL to
> > get index.html to show
> > >
> > > I'm not sure this is the right list for this question, but here goes.
> > >
> > > For some reason if I do the following
> > > 	http://myip/ericsworld
> > > I get an error, but if I do the following
> > > 	http://myip/ericsworld/
> > > The RaQ 3 goes ahead and gets the index.html that is in the
> > directory and
> > > displays it fine.
> > >
> > > Did anyone else have this problem, if so how did you fix it ?
> >
> > When you type http://yourip/ericsworld your browser sends a HTTP
> > request like:
> >
> > GET /ericsworld HTTP/1.0
> > Host: yourip
> >
> > and then, if ericsworld is a directory, receives a 404 (not found)
> > answer, so tries to get it as a directory:
> >
> > GET /ericsworld/ HTTP/1.0
> > Host: yourip
> >
> > If it does not work, it could be due to:
> > 1. A bug in your browser. Very unlikely, specially if it browses
> > correctly other websites.
> > 2. A missconfiguration in your server. You probably set a
> > 'ErrorDocument 404' directive in your httpd.conf or .htaccess that is
> > not handling correctly the 'not found' exception (that is, it does not
> > include a '404' header in the answer). This is very unusual with
> > Apache, unless you are using a .php, .cgi or .asp as
> > 'ErrorDocument 404'.
> >
> > I suggest that you comment any ErrorDocument directive and
> > restart Apache.
> >
> >
> > Julio López Garbayo
> > http://puntoycoma.net
> >
> >
> 




Julio López Garbayo
http://puntoycoma.net