On Jan 21, 2008, at 1:32 PM, Jerome Louvel wrote:
1. How do I turn directory redirection off? Specifically, if the
request refers to a directory and the URI doesn't end in '/', it's
OK for the server to add the '/' internally for processing, but I
don't want it to issue a 303 response.
The problem that arise if you don't force a redirect is that all
relative URIs served become harder to construct and read.
For example with the "/foo/bar" base URI, the "joe.html" relative
URI resolves to "/foo/joe.html" instead of the expected "/foo/bar/
joe.html" because the browser has no way to know that "/foo/bar" is
corresponding to a directory.
I understand the problem. I'm not saying "don't add the '/' at the
end"; I'm saying have a flag that silently adds it internally without
doing an explicit redirect. In the cases where you set
directoryRedirection to true, mutate the Request instead to append
the '/' as if you did the redirection and the client sent you back a
new request with the trailing '/'.
- Paul