[Instiki] How does instiki.org accomplish its URLs?
alex at verk.info
Sat Dec 24 01:07:07 EST 2005
Assaph Mehr wrote:
>I think instiki.org actually does it differently - i think it has an
>apache server in front that does the forwading internally.
It used to be that way some time back, but nowadays Apache just passes
everything to a different port.
config/routes.rb of Instiki (at least, the trunk version) contains the
following code snippet:
if defined? DEFAULT_WEB
explicit_path = generic_path.gsub(/:web\/?/, '')
explicit_routing_options = generic_routing_options.merge(:web =>
and then all routes to web-specific pages are defined as:
connect_to_web map, ':web/edit_web', :controller => 'admin', :action
Which means that if you add
DEFAULT_WEB = 'instiki'
to your config/environment.rb, it will route /show/HomePage same to the
same action and web as /instiki/show/HomePage.
Caveat: unfortunately, this also breaks some functionality in other
(non-default) webs (try to click on Recently Revised at
http://instiki.org/textilesandbox/show/HomePage). So, you cannot have a
default web on a multi-web Instiki installation. If someone could patch
routes.rb to make this scenario possible, I'll accept it without much ado.
More information about the Instiki-users