atom feed73 messages in org.apache.tomcat.usersRE: RewriteRules and Standalone Tomcat
FromSent OnAttachments
Kevin WilsonJan 7, 2003 8:47 am 
Jason PyeronJan 7, 2003 9:08 am 
Turner, JohnJan 7, 2003 9:14 am 
Jason PyeronJan 7, 2003 9:26 am 
Kevin WilsonJan 7, 2003 9:33 am 
Jason PyeronJan 7, 2003 9:41 am 
Turner, JohnJan 7, 2003 10:00 am 
RasputinJan 7, 2003 10:55 am 
Jason PyeronJan 7, 2003 12:40 pm 
Jason PyeronJan 7, 2003 12:47 pm 
Turner, JohnJan 7, 2003 12:58 pm 
nealJan 8, 2003 1:50 am 
Turner, JohnJan 8, 2003 7:15 am 
nealJan 8, 2003 12:54 pm 
nealJan 8, 2003 12:55 pm 
Turner, JohnJan 8, 2003 1:03 pm 
nealJan 8, 2003 1:34 pm 
Gary GwinJan 8, 2003 2:34 pm 
nealJan 8, 2003 2:46 pm 
Turner, JohnJan 8, 2003 3:24 pm 
nealJan 8, 2003 3:44 pm 
Turner, JohnJan 8, 2003 3:51 pm 
nealJan 8, 2003 3:55 pm 
Turner, JohnJan 8, 2003 5:33 pm 
Craig R. McClanahanJan 8, 2003 6:06 pm 
nealJan 8, 2003 6:28 pm 
Noel J. BergmanJan 8, 2003 6:33 pm 
Turner, JohnJan 8, 2003 7:19 pm 
Turner, JohnJan 8, 2003 7:26 pm 
Craig R. McClanahanJan 8, 2003 7:35 pm 
nealJan 8, 2003 11:06 pm 
nealJan 8, 2003 11:11 pm 
nealJan 8, 2003 11:17 pm 
nealJan 8, 2003 11:21 pm 
Craig R. McClanahanJan 8, 2003 11:23 pm 
nealJan 8, 2003 11:37 pm 
Craig R. McClanahanJan 8, 2003 11:51 pm 
nealJan 9, 2003 12:03 am 
Noel J. BergmanJan 9, 2003 12:08 am 
Turner, JohnJan 9, 2003 2:31 am 
Ralph EinfeldtJan 9, 2003 2:41 am 
nealJan 9, 2003 3:51 am 
nealJan 9, 2003 3:53 am 
Turner, JohnJan 9, 2003 5:22 am 
Turner, JohnJan 9, 2003 5:33 am 
Craig R. McClanahanJan 9, 2003 10:01 am 
nealJan 9, 2003 10:02 am 
Turner, JohnJan 9, 2003 11:16 am 
nealJan 9, 2003 11:25 am 
Noel J. BergmanJan 9, 2003 11:43 am 
nealJan 9, 2003 11:47 am 
Turner, JohnJan 9, 2003 12:09 pm 
Turner, JohnJan 9, 2003 12:11 pm 
Noel J. BergmanJan 9, 2003 12:33 pm 
nealJan 9, 2003 1:41 pm 
Turner, JohnJan 9, 2003 1:45 pm 
Jon EavesJan 9, 2003 2:58 pm 
nealJan 9, 2003 4:04 pm 
Jeffrey WinterJan 9, 2003 4:25 pm 
Craig R. McClanahanJan 9, 2003 5:43 pm 
Jeffrey WinterJan 9, 2003 6:10 pm 
Jeffrey WinterJan 9, 2003 6:11 pm 
Tim FunkJan 9, 2003 6:14 pm 
Craig R. McClanahanJan 9, 2003 7:08 pm 
Craig R. McClanahanJan 9, 2003 7:11 pm 
Tim FunkJan 10, 2003 4:29 am 
Jacob HookomJan 10, 2003 6:36 am 
Cox, CharlieJan 10, 2003 6:47 am 
Tim FunkJan 10, 2003 6:52 am 
AAron nAAsJan 10, 2003 7:03 am 
Jacob HookomJan 10, 2003 7:06 am 
Craig R. McClanahanJan 10, 2003 3:53 pm 
nealJan 19, 2003 10:10 pm 
Subject:RE: RewriteRules and Standalone Tomcat
From:Craig R. McClanahan (crai@apache.org)
Date:Jan 8, 2003 11:23:57 pm
List:org.apache.tomcat.users

On Wed, 8 Jan 2003, neal wrote:

Date: Wed, 8 Jan 2003 23:11:44 -0800 From: neal <neal@yahoo.com> Reply-To: Tomcat Users List <tomc@jakarta.apache.org> To: Tomcat Users List <tomc@jakarta.apache.org> Subject: RE: RewriteRules and Standalone Tomcat

So, in this scenario .. if a url without a directory is given and without a trailign slash, the redirect would not occur? That would fix this issue. I could certainly get behind that. :)

You will change that opinion as soon as you realize that relative URIs in your welcome pages do not work any more :-).

"if the final element of the path is a "directory" (or a context) without a trailing slash, redirect to the same path with a trailing slash. But if the path is given with a trailing slash, forward to the welcome file."

This is the right answer, IMHO.

It also includes the use case where you just say:

http://www.mycompany.com

which is (essentially) a request for the welcome file of the top-level directory of the ROOT webapp. This should be redirected to:

http://www.mycompany.com/

just like Apache does it, and then forwarded to the welcome file from there, so that relative URIs still work as expected.

Craig

-----Original Message----- From: Craig R. McClanahan [mailto:crai@apache.org] Sent: Wednesday, January 08, 2003 7:36 PM To: Tomcat Users List Subject: RE: RewriteRules and Standalone Tomcat

On Wed, 8 Jan 2003, Turner, John wrote:

Date: Wed, 8 Jan 2003 22:19:47 -0500 From: "Turner, John" <JTur@AAS.com> Reply-To: Tomcat Users List <tomc@jakarta.apache.org> To: 'Tomcat Users List' <tomc@jakarta.apache.org> Subject: RE: RewriteRules and Standalone Tomcat

OK, so what's the rationalization for the 302? Can you shed some light on that?

Consider a typical welcome page that includes:

<body> ... <img src="logo.jpg"> ... </body>

For a context path "/myapp", consider what happens when I type "http://www.mycompany.com/myapp" in to the browser. With a forward, the relative reference to logo.jpg gets resolved "wrong" (from the user's perspective) because it's the *browser* that resolves it. Want proof? Go back about three years when Tomcat 3.0 and 3.1 behaved this way, and "why don't images in a welcome page work" was a FAQ on TOMCAT-USER :-).

Changing to the current behavior was the result of a bug report about this, that had widespread support from the user community at the time.

Assuming that we can be compatible with the servlet spec language (for 2.4, that means convince the EG to clarify it this way), I think the right answer is the one proposed in the TOMCAT-DEV discussion -- if the final element of the path is a "directory" (or a context) without a trailing slash, redirect to the same path with a trailing slash. But if the path is given with a trailing slash, forward to the welcome file.

This still screws up relative references for people that use wierd welcome file paths like "foo/bar.html", but will work for the majority -- and it seems to be the way that Apache and other web servers deal with the issue.

John

Craig

-----Original Message----- From: Craig R. McClanahan [mailto:crai@apache.org] Sent: Wednesday, January 08, 2003 9:07 PM To: Tomcat Users List Subject: RE: RewriteRules and Standalone Tomcat

On Wed, 8 Jan 2003, Turner, John wrote:

Date: Wed, 8 Jan 2003 20:33:50 -0500 From: "Turner, John" <JTur@AAS.com> Reply-To: Tomcat Users List <tomc@jakarta.apache.org> To: 'Tomcat Users List' <tomc@jakarta.apache.org> Subject: RE: RewriteRules and Standalone Tomcat

No problem, glad to help. Remember, Tomcat is not a HTTP server. It supports HTTP as a matter of convenience. You can run Tomcat all day long without a HTTP or HTTPS connector, and as far as I know, there is nothing in the spec that says Tomcat has to meet certain requirements for HTTP or HTTPS. CoyoteConnector is HTTP/1.1 compliant, but again, that's more for convenience and compatibility than a design requirement.

Auoting from Servlet Specification, Version 2.3, Section 1.2:

All servlet containers must support HTTP as a protocol for requests and responses, but additional request/response based protocols (such as HTTPS (HTTP over SSL) may be supported. The minimum required version of the HTTP specification that a container must implement is HTTP/1.0. It is strongly suggested that containers implement the HTTP/1.1 specification as well.

So, a servlet container (which is either Tomcat standalone or Tomcat+Apache) *must* support HTTP.

I'm sure the folks on tomcat-dev could shed some more light on it.

Of course, this statement does nothing to resolve the issue of what the right welcome file behavior is -- the HTTP spec is silent about that :-).

John

Craig