# Task OP-1377 - Make subdirectory configuration less of a hassle

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-1377

## Details

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Date |  |
| Priority | Medium |
| Target versions | 3.0.4 |
| Category |  |
| Labels |  |

## Description

Currently, if you want to run your application locally in a subdirectory you have to do the following:

1\. Edit \`config/configuration.yml\` to include \`rails\_relative\_url\_root = “/subdirectory”\`  
2\. Edit \`config.ru\` changing the last line from

    run OpenProject::Application

to

    map (OpenProject::Configuration.rails_relative_url_root.presence || '/') do
      run OpenProject::Application
    end

The reason the default behaviour does not consider the subdirectory is because the default case for deployments of OpenProject is deploying it *Phusion Passenger* in which case the mapping in config.ru must not happen.  
As shown this, however, makes it necessary to change \`config.ru\` for local instances as well as for other scenarios, for instance *unicorn* deployments.

It should be changed so that it works with both *passenger* and other scenarios without requiring any change apart from setting *rails\_relative\_url\_root* in \`config/configuration.yml\`.

[Pull Request](https://github.com/opf/openproject/pull/1345)
