[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Mapping file-not-found to a .rb file?

Marc Heiler

8/15/2008 11:47:00 PM

I am using latest Apache on Linux. I would like to have something like
this:


localhost/query
localhost/query/foobar

All these should be mapped to a specific .rb file but I wonder which
limitation this would have (I'd want to have as few restrictions as
possible), and how to make this even possible at all. Would this require
mod_rewrite or are there simpler alternatives? Preferrable I would not
want to run a daemon .rb file.
--
Posted via http://www.ruby-....

1 Answer

Joshua Ballanco

8/19/2008 1:10:00 AM

0

Marc Heiler wrote:
> Would this require
> mod_rewrite or are there simpler alternatives? Preferrable I would not
> want to run a daemon .rb file.

You could just make a Ruby cgi script. Then, yes, some mod_rewrite
trickery should get you the desired results.

However, you might want to reconsider running a daemon .rb file. The
main reason that Rails/Rack/etc. go this route is that starting a Ruby
process is often the most intensive part of running a Ruby script
(doubly-so in the case of JRuby). Having a Ruby process idling and
waiting for requests is often more efficient.
--
Posted via http://www.ruby-....