httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@en.muc.de>
Subject Re: Items for 1.2
Date Sun, 28 Jul 1996 14:24:03 GMT
On 28 Jul 1996 15:09:35 +0200 in en.lists.apache-new-httpd you wrote:
> Various things I'd like to get feedback on for Apache 1.2:

> [...]
> 3) mod_rewrite. mod_rewrite_compat probably needs more testing, but I'd
>    like to place mod_rewrite into the default distribution. *However*,
>    having looked at the module's source in greater depth, I'd like to
>    make a number of changes first (Ralf, do you mind? Or if you'd perfer
>    to make them yourself, that'd be fine):

First, please give me a change to try it myself in v2.1 and if the result
isn't good enough please do some more changes yourself. But send my all
changes back to me, because I want to maintain mod_rewrite myself.  And
because I'm written mod_rewrite for the Apache team and not for myself I will
try hard to change anything as the Apache team wants. I don't want to have a
own mod_rewrite which is different from the mod_rewrite which is included in
the Apache distribution.

>    a) Obviously, it needs to be rewritten to use POSIX regex instead of
>       V8. The one nick here is POSIX regex' lack of an equvilent of
>       regsub(). However, this should be very simple to write (and should
>       be put into util.c for use by other functions).

Yes, this is on my todo list. It would be nice if you could support a regsub
function, because it is allways useful to have one, not even for mod_rewrite.
If you supply such a beast, mod_rewrite v2.1 will contains changes to support
the POSIX interface of the regexp code apache includes.

BTW: The current CVS-snapshot still hasn't the regexp code included. Not yes
commited?

>    b) It's not quite up to the normal Apache API standards. Specifically,
>       the way it parses args, handles errors, and a couple other things.

Hmmm... please give me more details, Alex.
What did I make wrong? The arg parsing uses the "raw" functionality of
Apaches config and it is the only possibile way to get 3 args and to avoid \\
instead of \, etc.

Error handling: Ok, that could be better: Just give some hints I will change
it. 

>    c) Memory use. It uses MAX_STRING_LEN all over the place. Most of that
>       can (and should) be replaced with the pstr* functions.

Hmmm... yes. I will change this in v2.1, you are right.

>    d) The RewriteEngine directive seems superfluous; it should be implied
>       by the existance of RewriteRule.

Hmmmm.... yes and no! I introduced it to be able to disable the whole engine
while RewriteRule directives are setup. If you don't have this directive you
have to comment out all RewriteRule directives which can be horrible,
e.g. I have 20-30 directives in my httpd.conf!

>    e) RewriteLog should default to off.

Yes! That is a good decision. I currently still changing the logging facility
and will do this change, too.

>    f) Most importantly, it should not, ever, under any circumstances,
>       change r->uri, as it does now. It should keep track of its
>       internal state in an internal variable. I'm also not sure about
>       making URI and filesystem paths treated the same; it seems to have
>       the propensity to get messy; I have to think more about it, though.

Hu! You are faster then me, Alex! This is NO#1 on my todo list, because
it causes some problems, e.g.
   1. a redirect in mod_imap.c causes the homesubdirs (e.g. .html-data or
      .www) to be used.
   2. the tidle expansion (~user -> /.../user, etc.) takes please
      even on redirects and should only be done for real uri-to-filename
	  changes
   etc.

I want to do it this way in v2.1:

mod_rewrite uses internal buffers for r->uri and r->filename. The
RewriteRules are per default applied to the filename. But there is a option
to be able to apply a rule to the URI (for rewrites prior to redirects, etc.)
At the end of a rewriting process, it sets r->filename and if the uri was
also rewritten, it sets r->uri, too.

Is this ok?

>    However, except for these things (and maybe some others), it looks
>    to be a very well-done module, and I (to repeat myself) would like to
>    see it as part of the default Apache package.

Thanks! I will do my best to add the requested changes and provide as fast as
I can mod_rewrite v2.1 which should fit better to your requests.  If you
change something yourself, please send the changes to me, too. I want to
support mod_rewrite in the future, too.

Greetings,
                                        Ralf S. Engelschall    
                                        rse@engelschall.com
                                        http://www.engelschall.com/~rse

Mime
View raw message