[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-developers] Re: cobalt-developers digest, Vol 1 #451 - 6 msgs
- Subject: Re: [cobalt-developers] Re: cobalt-developers digest, Vol 1 #451 - 6 msgs
- From: Brian Curtis <admin@xxxxxxxxxxx>
- Date: Sun Jan 21 04:38:00 2001
- Organization: Pomfret Computer Technologies, LLC
- List-id: Discussion Forum for developers on Cobalt Networks products <cobalt-developers.list.cobalt.com>
>> Reply-To: <eat@xxxxxxx>
>> From: "Eric Arseneau" <eat@xxxxxxx>
>> 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 ?
Actually, this is the normal behavior for Apache (and browsers). When you access a
site without the trailing slash, and your using the IP, Apache will
try to convert the IP into the VHOST's "ServerName".
The way Julio described it is exactly how the request works. You make
a request to Apache:
client => 123.123.123.123:80 => GET /somedir
To Apache, your browser, and the RFCs, you just asked for a file, not
a directory. Although, Apache is smart enough to check for a directory
of the same name before sending a complaint. However, when Apache
makes the second request, it also checks the hostname you asked for.
Since you don't usually set the IP as the "ServerName" or a
"ServerAlias", Apache will automatically convert it for you, and send
a response which now includes the ServerName instead of the IP.
Apache responds to above question:
[internal: GET /somedir (404) - GET /somedir/ (found)]
=> reply to client:
HTTP/1.1 301 Moved Permanently
Date: Sun, 21 Jan 2001 12:15:59 GMT
Server: Apache/1.3.12 (Unix)
Location: http://virtualdomain.com/somedir/
Connection: close
Content-Type: text/html; charset=iso-8859-1
Apache also throws out a small segment of HTML, in case the browser
doesn't understand the "Location" header, which includes a link to the
new location.
You're receiving an error because the domain that Apache responds with
does not resolve properly yet.
The easiest way to cope with this is to make sure your DNS is setup
properly and wait for propagation of any changes, or make sure to include
the trailing slash on all IP based requests. Other ways to get around
it would be to modify your machine's hosts file, or try adding the IP
as a "ServerAlias" to your httpd.conf (though I have come across at
least one broken version of Apache which ignores the ServerAlias entry
and heads straight for the ServerName).
--
Best regards,
Brian Curtis