[Bese-devel] static/dynamic content at the same url prefix

Attila Lendvai attila.lendvai at gmail.com
Mon Sep 4 15:43:01 UTC 2006


hi!

recently i was trying to clean up the way UCW matches urls. i ended up
with a solution that does not allow static/dynamic content at the same
url. the reason behind this is partially that i can't configure
apache2 accordingly. the old LocationMatch on .*\.ucw solution is not
working with the extended new dispatchers, although as a final resort
their urls could be renamed, but it feels a bit hackish.

what i'm actually looking for is a way to have apache try to serve the
request as a file but if the file was not found then forward the
request to mod_lisp. here are the thngs i've tried:

1) mod_rewrite ({REQUEST_FILENAME} won't work, we need to handle entire paths)
RewriteCond   %{REQUEST_URI} !-U
RewriteRule   ^/(l10n/|shared-counter/|)(.*) /lisp/$1/$2

the problem with this is that -U will always match if any AliasMatch
is matching, even if there's no such file on the disk. and i couldn't
make a regexp that matches ^/(l10n/|shared-counter/|)(.+) as i want it
(.+ always gets greedy and when accessing /l10n/static-content $2
contains the l10n part, too, as if it were a static content of the
example app at "/").

2) ErrorDocument
seems like it's only a static url, which is not enough for this. some
cgi stuff was mentioned somewhere, but...

and in general, what do you think about a constraint that the static
and dynamic content of an app may not overlap? currently
/url-prefix/ucw/ and /url-prefix/dojo/ are the static content url's of
ucw itself (that map to the corresponding dir in www-root) and for the
examples and for my own app i map /url-prefix/static/. i'm a bit
hesitant about this, but maybe this is the cleanest and easiest
solution...

any ideas/opinions? Marco?

-- 
- attila

"- The truth is that I've been too considerate, and so became
unintentionally cruel...
 - I understand.
 - No, you don't understand! We don't speak the same language!"
(Ingmar Bergman - Smultronstället)


More information about the bese-devel mailing list