Project

General

Profile

Actions

Defect #2508

closed

Do not use absolute URL !

Added by Martin Letendre over 15 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-01-14
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Everywhere in the application you should use relative URL instead of absolute URL. For example in the login page you have this reference to a javascript file(this URL is absolute! ):

<script src="/javascripts/main.js?1215344801" type="text/javascript"></script>

You should have this reference instead:

<script src="javascripts/main.js?1215344801" type="text/javascript"></script>

This is really important if you use redmine in a corporate environment where there is often a web server configure in a reverse proxy mode (example: apache httpd) in front of the web application (ex: redmine).

PS: Reverse Proxy http://en.wikipedia.org/wiki/Reverse_proxy


I found this issue while installing apache httpd behind redmine in an enterprise context. Here is my apache httpd configuration.

ProxyPass /redmine https://redmine-host:3000/
ProxyPassReverse /redmine https://redmine-host:3000/

This configuration means: if you receive a query at https://apache-httpd-web-server-host/redmine than redirect the request to http://redmine-host:3000/

The problem with using absolute URL is that you break this process.

-------------------------------------------------------------------
For example the link to your JavaScript file should be (with relative URL):

https://apache-httpd-web-server-host/redmine/javascripts/main.js?1215344801

Because you’re using absolute URL it search for an unexisting resource

https://apache-httpd-web-server-host/javascripts/main.js?1215344801


In conclusion:

Absolute URL is like Crossing the Streams ... http://www.youtube.com/watch?v=8jJ2WnRjzWs

Actions

Also available in: Atom PDF