This page explains how to run Redmine in a subdirectory of your site, for instance http://www.mysite.com/redmine/ ; in such a case, you can feel lost because the classic Redmine install does not work directly, and the links to css or javascript files seem to be broken. In this page, we assume you want to run Redmine under "/redmine/" subdirectory of your site.

Rails will then prefix all links with "/redmine". It can be considered as the simplest, cleanest and most flexible solution. Then restart your application. In more recent versions of Rails the class hierarchy has changed slightly and you will need to use

If you run Redmine under Mongrel server, you can alternatively use the "--prefix" option of Mongrel :

mongrel_rails start --prefix=/redmine

Mongrel_rails service "--prefix" directive does NOT work with Rails 2.3.xTo fix this issue create a file config/initializers/patch_for_mongrel.rb [name of file can be anything]:

# Fix for mongrel which still doesn't know about Rails 2.2's changes,
# We provide a backwards compatible wrapper around the new
# ActionController::base.relative_url_root,
# so it can still be called off of the actually non-existing
# AbstractRequest class.
module ActionController
class AbstractRequest < ActionController::Request
def self.relative_url_root=(path)
ActionController::Base.relative_url_root=(path)
end
def self.relative_url_root
ActionController::Base.relative_url_root
end
end
end
#
# Thanks to http://www.ruby-forum.com/topic/190287

You may not run Mongrel on port 80 : if you have an Apache server on the same host, and you run Mongrel on port 8000, you can use the following Apache config to redirect (with Apache's mod_proxy enabled) :

If you have an Apache webserver in front of it (with mod_proxy enabled), or an Apache reverse proxy on another machine, you can run Redmine on a specific port and use this kind of config so it appears to be running in a subdirectory :

If you run a very old version of Redmine (don't know exactly which ones), maybe your version of Rails' ActionController does not support the "relative_url_root" mentionned above. Then you can look at this page to reproduce the same behaviour, but it is NOT a very good idea in most cases, you should consider upgrading Redmine.