Simple URL rewrite

Added by Yassen Damyanov about 14 years ago

I have two instances of Redmine running as fcgi daemons, each being a different "environment". I want to access each of them via URLs like these:

The web server forwards the request to the correct instance based on the URL's first segment (/one or /two), but I cannot get it to rewrite the URL to remove that segment and thus each of the Redmine instances gets URLs that it does not understand.

Is there a way to handle this via Rails URL routes? I guess so, but all my attempts to understand how that stuff works and how to get it doing what I need to, are in vain.

I am pretty much stuck with this; any piece of advice would be highly appreciated.
yassen

Replies (5)

RE: Simple URL rewrite - Added by Yassen Damyanov about 14 years ago

A plea for help again:

I understand that this is more of a Rails issue than Redmine; and I made every effort to read and understand the Rails URL handling stuff in order to be able to handle this case, but alas, that is (so far) beyond my power to understand. Still, ANY direction or advice would be greatly appreciated.

RE: Simple URL rewrite - Added by Jean-Baptiste Barth about 14 years ago

Maybe this article will help you ? I had a similar problem last week but finally decided not to use subdirectories... Good luck :-)

RE: Simple URL rewrite - Added by Yassen Damyanov about 14 years ago

Jean-Baptiste: Thank you!! This looks like EXACTLY what I need to overcome this issue. I need more than two (a LOT more than two) Redmine instances running in parallel, maybe adding or removing some on the way, so subdomains are not an option in my case. This link looks like a life saver for me. Right now I cannot try it, but I will tomorrow and I'll post back here (good news, hopefully...) Thanks again!!

RE: Simple URL rewrite - Added by Yassen Damyanov about 14 years ago

Jean-Baptiste: Thanks again for the hint! The reference indeed helped me. It all took enormous time, but it really works now, hallelujah!

I have a different issue however: I run Redmine via FCGI, and everything seems to work great, except that I try to run it under httpS and after the first redirect (from the login page to the home) it reverts back to plain http. Yes, I've set the protocol correctly in the Settings page; also, being in despair, changed the conf/settings.yml entry:

protocol:
  default: https

All this does not help at all.

My web server is Hiawatha (http://hiawatha-webserver.org/) and RoR + Redmine runs as an FCGI daemon. OS: Debian Etch. Redmine checked out yesterday from the 0.8-stable branch.

Anyone with slightest idea what that might be and how to fix it? Tried to find a similar issue or forum entry, but could not. Shall I report this as a bug? (I guess no, if no one had that problem, the issue might come from the web server ... or from peculiar environment...)

Thanks in advance!

RE: Simple URL rewrite [SOLVED] - Added by Yassen Damyanov about 14 years ago

I am obviously talking to myself ;)) but YES, I've got it!

One needs to get the web server to set an environment variable HTTPS to a value 'on'; and that does the trick! For Hiawatha, this is done simply by adding this line to the virtual host section:

VirtualHost {
    .
    .
    Setenv HTTPS = on
}

Works great! :))

(1-5/5)