Defect #14179


redmine base url wrong in email when relative_url_root set.

Added by C Tibirna almost 11 years ago. Updated almost 8 years ago.

Email notifications
Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected version:



This report is for git SHA cc23ab9.

I upgraded recently a redmine installation from 1.4 to 2.3.1. We install in a relative_url_root (called /projets) and not in the root of the server.

The first issue I encountered was that

Redmine::Utils::relative_url_root = "/projets" 

in the environment.rb config file doesn't work anymore. After digging in the "Issues" collection here on, I found some workaround, by adding:

RedmineApp::Application.routes.default_scope =  { :path => '/projets' }

in environment.rb.

The report was advising using RedmineApp::Application.routes.default_scope = { :path => '/projets', :shallow_path => '/projets' }, but the shorter version seems to work too. Pages are displayed correctly, RSS feeds have the right URLs too.

Anyways, no matter what I try, the email notification messages contain the wrong URL: ''. The relative_url_root is repeated.

Please advise.

NOTE: the relative_url_root configuration should be given a prominent and clear explanation in the RedmineInstall document. It is always a pain to figure out. I don't have data to back my next affirmation, but I believe a good portion of redmine installations are done on servers that contain other things apart redmine, thus requiring relative_url_root configurations.


mail attachment..png (20.5 KB) mail attachment..png Timmy Vercruysse, 2016-05-02 16:34
mail attachment.png (20.5 KB) mail attachment.png Timmy Vercruysse, 2016-05-02 16:34
Actions #1

Updated by C Tibirna almost 11 years ago

Given my lack of ruby/rails/redmine experience, I had to resolve myself to grepping the sources (to no avail) and digging the internets (with mixed results).

Finally, I fell over and I realized that my problem might come from that too: the value of "Administration/Configuration/General/Host name and path" config option.

Lo and behold, it turns out I had configured there, from the time of redmine 1.4:
And now, with redmine 2.3, I had to trim it to:

This means that there is a changed (undocumented) behavior in redmine 2.3, which automatically adds the relative_url to the full value of that config option.

So, I have my workaround, but there remain 2 issues:
- lack of exact documentation about that config option
- not adding relative_url automatically, as it seems to defeat the purpose (is there one?) of that config option.


Actions #2

Updated by Timmy Vercruysse almost 8 years ago

I've tried it but i seems like i still have problems with the picture in mails.
The urls to the attachements are good, but the inline picture doesn't come up.
!mail attachment.png!
Does anybody know where to change the url of the inline picture's.

Actions #3

Updated by Toshi MARUYAMA almost 8 years ago

Timmy Vercruysse wrote:


FTR: #22712.


Also available in: Atom PDF