URL Matching

jbj at forbidden.co.uk jbj at forbidden.co.uk
Sat Apr 21 15:38:47 UTC 2007

On Fri, Apr 20, 2007 at 09:54:29PM +0000, Brad Fitzpatrick wrote:
> I'm personally not a fan of the Apache regexp -> Perl regexp code, which
> to me is just more complicated, having to remember two regexp syntaxes,
> but it looks like it's perfectly find code.
> Jeremy, did you want this (or a variation on it), included in the core
> distribution, or would you prefer to keep it as a plugin?

I just want to quickly give a bit of context on this plugin. We use
perlbal to provide a serving platform for a Java Applet, which impose
a fair number of security restrictions - including only being able to
fetch content from the same host that the applet was served
from. Therefore, we needed a way to serve varied content referenced by
URL, rather than through different hosts, as you would for a more
typical large-scale website.

I personally prefer glob-style syntax for URL matching - but the only
reason is really because '*' is easier to write than '[^/]*'. In
addition, it makes the comparison of URLs used in apache <Location>
tags easier to compare across config files. Actually, we use
<LocationMatch>s quite a lot these days, so this is a moot point.

I like the fact that Atsushi's code includes host support (although I
don't quite understand how the example config would work?). Perhaps it
wouldn't seem unreasonable to extend the vhost syntax to handle URLs
as well?

Some optional functionality that I would appreciate would be some
minor URL-rewriting abilty for URLs that are matched - something that
trims the URLs before passing them on to their backend. This allows
you to have a /static/ directory serving up files from a given
directory /X/, without having to instead put them into a directory

Anyway - I can help with some amount of re-writing of code until it is
suitable for inclusion (and to a specification of which is suitable
for other perlbal users - I appreciate that anything to do with URL
design can get rather opinionated) - unittests to be included, of

Best wishes,

More information about the perlbal mailing list