Was wondering whether this sub-uri works successfully in latest version of Gitorious? I've tried a new local install (within a 'mydomain.com/gitorious' sub-folder), but the instant I log-in, I get re-directed to the base uri (same happens for log-out, just as with this initial thread). I grepp'ed around the code looking for any references to *redirect_to "/"* mentioned, but didn't find too many references to that around in the code anymore.
Regards, Gurce On Thursday, 4 June 2009 18:28:59 UTC+10, Marius MÃ¥rnes Mathiesen wrote: > > On 3. juni. 2009, at 19.06, Steve Hajducko wrote: > > > > We installed gitorious on a system where we have several other rails > > apps running and I've got it running in a mongrel+apache setup with > > mod_proxy. > > > > The problem we're running into is that we run the app as > http://host.example.com/git/ > > - We've found is that there are certain times when gitorious redirects > > the user back to /, which ends up being some other site rather than > > the app. > > Did you tell Rails about the sub uri you're using? You can do this in > your environment file (config/environments/<rails_env>.rb) like so: > > config.action_controller.relative_url_root = "/git" > > This way, Rails knows that you're running Gitorious on a sub uri and > will adapt its route generation and helper methods to accommodate > this. For instance, the stylesheet_link_tag and image_tag helpers will > prepend "/git" to any css/image references it makes, and the routing > will do the same. Same goes for javascripts. > > Once this is done, Gitorious should work in most cases, with a few > exceptions: > > - Whenever there's a redirect_to "/" - this is sloppyness on our > behalf, sorry. I actually didn't find that many references to such > redirections, but luckily Rails supplies a special route for this: > root_path (and root_url). So whenever there's a: > > redirect_to "/" > > this should be changed to > > redirect_to root_url > > No need for a special gitorious_root_path, as this is already built > into Rails. We'd really appreciate a patch if you find the time to do > this! > > As for image/css references, these should be okay wherever the > image_tag and stylesheet_link_tag are used. Image references inside > your CSS files, however, are a different issue, as these are static > files without any knowledge of the actual URL schemes used by > Gitorious. You could create a script that changes image references in > the CSS file to their correct location, however this would probably be > a tedious and error-prone process. Another solution would be to use > URL rewriting to intercept requests for images included in > stylesheets. This, however, would need to be done on the root of your > web servers, as this is where the requests will be handled. If you > create a rewrite rule that matches /images/* for files that don't > exist in the file system, these URLs could be rewritten to "/git/ > images/*". > > Regards, > - Marius > > -- To post to this group, send email to gitorious@googlegroups.com To unsubscribe from this group, send email to gitorious+unsubscr...@googlegroups.com