httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Malo ...@perlig.de>
Subject Re: [Patch] Simplifying mod_alias
Date Sun, 21 Dec 2014 14:18:17 GMT
Hi,

I think, most of the directives are compatibility ones. IMHO the best way to 
handle a transition to a different configuration concept would be to 
introduce a new module (mod_alias_ng or mod_fs_map or so...) instead of 
patching the current one and producing a lot of anger (Alias* and Redirect* 
are often used in my experience, also in combination with proxy and rewrite 
stuff). Additionally this could serve as a kind of an A/B test to test your 
configuration (and see if people really like it, if anybody cares about 
that).

nd

* Graham Leggett wrote:

> On 27 Jan 2014, at 12:11 AM, GRAHAM LEGGETT <minfrin@sharp.fm> wrote:
> > A look at mod_alias shows it has 7 directives:
> >
> > • Alias
> > • AliasMatch
> > • Redirect
> > • RedirectMatch
> > • RedirectPermanent
> > • RedirectTemp
> > • ScriptAlias
> > • ScriptAliasMatch
> >
> > In theory we only need these three:
> >
> > • Alias
> > • Redirect
> > • ScriptAlias
> >
> > What I'm keen to do is enable expression support and deprecate all but
> > the above, with the following as the preferred configuration method
> > (same as the one used by ProxyPass):
> >
> > <Location /foo>
> > Alias /var/lib/bar
> > …stuff...
> > </Location>
> >
> > or
> >
> > <LocationMatch ^/foo/(?<bar>[^/]+)>
> > Alias /var/lib/%{env:MATCH_BAR}/baz
> > …stuff...
> > </LocationMatch>
> >
> > In theory this would be faster as we would not be scanning the list of
> > Aliases followed by the list of Locations each time, and things get a
> > lot simpler to use.
>
> This patch implements the above.
>
> The idea is that the existing syntaxes remain unaltered (and can be
> deprecated in future), while we introduce new Location syntaxes with a
> single argument, like so:
>
> <Location /image>
>   Alias /ftp/pub/image
> </Location>
> <LocationMatch /error/(?<NUMBER>[0-9]+)>
>   Alias /usr/local/apache/errors/%{env:MATCH_NUMBER}.html
> </LocationMatch>
> <Location /one>
>   Redirect permanent http://example.com/two
> </Location>
> <Location /three>
>   Redirect 303 http://example.com/other
> </Location>
> <LocationMatch /error/(?<NUMBER>[0-9]+)>
>   Redirect permanent http://example.com/errors/%{env:MATCH_NUMBER}.html
> </LocationMatch>
> <Location /cgi-bin >
>   ScriptAlias /web/cgi-bin/
> </Location>
> <LocationMatch /cgi-bin/errors/(?<NUMBER>[0-9]+)>
>   ScriptAlias /web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi
> </LocationMatch>
>
> Big win: three fewer reasons to use mod_rewrite (and maybe
> mod_vhost_alias).
>
> Regards,
> Graham
> —



-- 
"Umfassendes Werk (auch fuer Umsteiger vom Apache 1.3)"
                                          -- aus einer Rezension

<http://pub.perlig.de/books.html#apache2>

Mime
View raw message