Forum: Ruby on Rails setting relative_url_root for static files in webrick

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ba9493e09680dfc7c5807eae5a01c8d7?d=identicon&s=25 Henning Sprang (Guest)
on 2006-03-08 00:08
(Received via mailing list)
I am using webrick and want my application not be available on
http://localhost:3000/ but http://localhost:3000/rails.

So I found out I can set
ActionController::AbstractRequest.relative_url_root = "/rails"
in environment.rb.

This works for controllers without further modifications. But for the
static files, I have to put a "rails" directory into the public
directory, and move my static files in there. This was the only way I
found to solve this. But I imagine it should be possible to keep the
original public structure, but tell webrick to serve that in /rails
instead of /.

Is this possible?

This topic is locked and can not be replied to.