Upon doing some research I understand that this is a matter of editing routes.rb - but what changes do I need to make in order to conceal the web name? Many thanks
Hi Oscar,> Upon doing some research I understand that this is a matter of editing routes.rb - > but what changes do I need to make in order to conceal the web name?This is untested, but it should work if you have one web only. Wherever there is a reference to :web in the map, just remove it and add a parameter with the web address. E.g. if you have one web called ''oscar'' then change: connect_to_web map, '':web/:action'', :controller => ''wiki'' to connect_to_web map, '':action'', :controller => ''wiki'', :web => ''oscar'' in all relevant places. I think instiki.org actually does it differently - i think it has an apache server in front that does the forwading internally. There should be notes on how to do this in the wiki. HTH, Assaph
Alexey Verkhovsky
2005-Dec-24 06:07 UTC
[Instiki] How does instiki.org accomplish its URLs?
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 => DEFAULT_WEB) map.connect(explicit_path, explicit_routing_options) end and then all routes to web-specific pages are defined as: connect_to_web map, '':web/edit_web'', :controller => ''admin'', :action => ''edit_web'' 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. Best regards, Alexey Verkhovsky
Thanks to both of you for your help. Both suggestions work perfectly! Happy holidays>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 => >DEFAULT_WEB) > map.connect(explicit_path, explicit_routing_options) > end > >and then all routes to web-specific pages are defined as: > connect_to_web map, '':web/edit_web'', :controller => ''admin'', :action >=> ''edit_web'' > >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. > >Best regards, >Alexey Verkhovsky