httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay O'Brien <jayobr...@att.net>
Subject Re: [users@httpd] Help with trailing slash
Date Tue, 28 Dec 2004 21:53:43 GMT
Leif, Thank you for your very helpful response.  My replies are 
included below. 

Jay


Leif W wrote:

> Replying to segments out of order or original post.
> 
> 
>>Jay O'Brien; 2004 December 28 Tuesday 02:41
>>
>>That is, If I type http://66.93.180.184 into the browser over the
>>internet, I get /home/jay/www/home.html as expected. However,
>>entering http://66.93.180.184/rl doesn't work; Mozilla times out
>>and displays "The operation timed out when attempting to contact
>>192.168.1.9". However, if I add the trailing slash, typing
>>http://66.93.180.184/rl/ displays  /home/jay/www/rl/home.html as
>>expected. http://66.93.180.184/sscc without the trailing slash
>>also fails; as before, it works fine with the trailing slash.
> 
> 
> 
> All of these seemed to work just fine with no trailing slash using 
> Mozilla Firefox 1.0, Mozilla 1.8a5 and IE6 under WinXP over the 
> internet.  Maybe you fixed it already?  Odd that it gave you the 
> internal IP address.  Something was either natted funky or was not 
> listening correctly?
> 
>  http://66.93.180.184
>  http://66.93.180.184/rl
>  http://66.93.180.184/sscc
>  http://66.93.180.184/tech
> 

Interesting. The /rl and /sscc still don't work here, and I have 
made no changes. What blows me away is that the /tech address works 
fine, but the others don't. I'll try another computer on that ISP, 
and perhaps someone else will try http://66.93.180.184/rl and report 
that it didn't work for them until they added a trailing slash. It 
would be nice if the problem is only my test computer, but I doubt it.

> 
>>I really want ANY instance of a URL being asked for without
>>the final trailing slash to find the home.html file in the
>>directory being asked for.
> 
> 
> 
> This can get hairy if you use nontrivial regexs later on.  It's so much 
> easier if everyone just typed it into the clients, or all pages on the 
> site use trailing slashes, and all old bookmarks get updated.  But it's 
> not always the case that you can control these things, so you need a 
> sensible fallback.  But I never rely upon the fallback as the default 
> scenario especially when the incorrect action is so easily changed.
> 
> 
>>Any guidance will be very much appreciated.
> 
> 
> 
> First of all, use the trailing slash!  If it's not typed, the client 
> doesn't know if you're requesting a file or directory.  The server won't 
> know either until it looks for a file that is actually a directory, and 
> thus needs the trailing slash to apply those directory rules, so it 
> tries to be helpful and sends a message back to the browser with the 
> slash, and the browser makes a second request.  That's a lot of extra 
> work for everyone else just because you are too lazy to type one blasted 
> character!  ;-)
> 
> Furthermore some OSes may actually allow a file name to be the same as a 
> directory name, since one is a file and one is a directory.  I think 
> it's probably rare though, but may explain where the strictness came 
> from.
> 
> 

I agree on "use the trailing slash". However, I can't control folks who 
have learned to look for my url, a slash, followed by two or three 
letters and no slash. That works fine on my present server; I would like 
to emulate that behavior on my own (to be the backup) server. My present 
commercial server uses Apache 1.3.31; it seems to me I should be able to 
make mine work the same. 


>>Following http://httpd.apache.org/docs/misc/rewriteguide.html
>>I tried the following:
>>
>>Built /home/jay/www/.htaccess:
>>RewriteEngine  on
>>RewriteBase    /66.93.180.184/
>>RewriteRule    ^rl$  rl/  [R]
>>This didn't work.
>>
>>Built /home/jay/www/.htaccess:
>>RewriteEngine  on
>>RewriteBase    /66.93.180.184/
>>RewriteCond    %{REQUEST_FILENAME}  -d
>>RewriteRule    ^(.+[^/])$           $1/  [R]
>>This didn't work.
> 
> 
> That's kind of like what I said.  A lot of extra work.  That's what the 
> server should already be trying to do.  Using rewrites may not 
> necessarily get you anywhere, and may in fact confuse the issue.
> 

Ok, but that's all I could find that seems to address the trailing slash 
problem, so that's what I tried.

> 
>>The problem is NOT present with IE, only with Mozilla. And the
>>problem is present on some, but not all, subtending directories
>>when using Mozilla. When the problem is present, the error
>>message says it timed out attempting to contact 192.168.1.9,
>>not 66.93.180.184 as would be expected over the internet.
> 
> 
> I have no idea why.  :p  Try reformatting the hard disk and reinstalling 
> everything on the client machine, becaused that's just not right.  ;-) 
> Joking.

Good answer, but the client machine gets the pages just fine on my 
commercial server. BTW, have you ever worked in tech support? :-)

> 
> Maybe it was a firewall misconfig?  It would make sense.  It would 
> depend if the firewall is doing masquerading or routing.  When the 
> firewall talks to the web server and sends the packets, does it mangle 
> the destination and change it from the internet address to the local 
> address?  I've had a config with a Linux doing masquerading and the web 
> server behind it, and requests to the web server on the local IP looked 
> to the web server as if they were destined for the external IP of the 
> Linux box.  I had to listen on both the internal and external IPs.
> 
> 
Yes, I think this could be the issue. I really don't know what the Linksys 
BEFSR41 does when it connects port 80 to the Apache server.


>>In httpd.conf, I have ServerName set to 66.93.180.184, and
>>UseCanonicalName Off. I've changed DirectoryIndex to have
>>home.html as first choice. I've changed ServerName to a fake
>>URL, and it still times out attempting to contact 192.168.1.9.
> 
> 
> Either specify the two addresses explicitly, or use 0.0.0.0 to listen on 
> all addresses.
> 
> Listen 192.168.1.9:80
> Listen 66.93.180.184:80
> 
> NameVirtualHost 192.168.1.9:80
> NameVirtualHost 66.93.180.184:80
> 
> <VirtualHost 66.93.180.184:80 192.168.1.9:80>
>     ServerName whatever:80
> ...

Thanks, I'll play with that. 

> .
> 
> Leif


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message