logo       

Semantic problems with mod_rewrite and [F]CGI scripts.: msg#00055

web.lighttpd

Subject: Semantic problems with mod_rewrite and [F]CGI scripts.

I've been working with the Ruby on Rails crowd, trying to make Lighttpd
work with the Rails development environment/framework.

At its core, Rails is just a web app framework, but it does depend on a
URL-rewriter, specifically mapping URLS in the form
of /base/CCC/AAA/III?qqq to /dispatch.[f]cgi?
controller=CCC&action=AAA&id=III&qqq

It also needs to be able to construct self-referencing URLs, and that's
where trouble strikes. The CGI and FastCGI specs are notably silent on
issues like this, mostly because URL-rewriting is completely black
magic.

In the case of a rewrite like that, Lighttpd sends a REQUEST_URI
of /dispatch.fcgi?controller=CCC&action=AAA&id=III. Rails has no way to
know what URL the user is seeing, and can't construct an appropriate URL
for other actions.

Apache (and I'm hardly arguing that what Apache does is right) puts the
original URI in REQUEST_URI, and the docs for other apache modules hint
that it should put the rewritten in REDIRECT_URI (or vice versa). In
practice, it puts the original in the REDIRECT_URI, too.

I'd love ideas on what the Right Thing might look like, and secondarily,
clean ways to implement them in lighttpd. I have an experimental patch
(http://codepaste.net/view/paste/147) that makes Rails go, but it's not
semantically clean at all.

Have a good day.

Ari




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise