Skip to content

Installing Publify in a sub URI

Matijs van Zuijlen edited this page May 19, 2017 · 5 revisions

Installing Publify in a sub-URI should work, since this is supported by Rails. See http://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root for general information about configuring Rails to run in a sub-URI.

Be aware that you also need to tell Rails about the relative URL root during asset compilation. The simplest way to do this is to set the RAILS_RELATIVE_URL_ROOT environment variable.

For example, if you're using Capistrano, you can add the following to your config/depploy.rb file, replacing /blog with the relevant sub-URI:

set :default_env, { rails_relative_url_root: '/blog' }