From what I gather on the wiki ( ) running rails in a subdirectory
should be pretty much automatic. However I have a rather frustrating set
up of fastcgi/rails and IIS. I was forced to modify
actionpack/lib/action_controller/request.rb because it was failing to
pull the route off the URL correctly (I would always end with the path
to the fcgi script instead).
def request_uri
unless env[''REQUEST_URI''].nil?
(%r{^\w+\://[^/]+(/.*|$)$} =~ env[''REQUEST_URI'']) ?
$1 :
env[''REQUEST_URI''] # Remove domain, which webrick puts into
the request_uri.
else # REQUEST_URI is blank under IIS - get this from PATH_INFO
and SCRIPT_NAME
script_filename = env["SCRIPT_NAME"].to_s.match(%r{[^/]+$})
#request_uri = env["PATH_INFO"]
request_uri = ""
# script_filename contains the path all the way to the script for me...
request_uri.sub!(/#{script_filename}/, '''') unless
script_filename.nil?
request_uri += env["QUERY_STRING"] unless
env["QUERY_STRING"].nil? || env["QUERY_STRING"].empty?
return request_uri
end
end
This seemed to do what I wanted all the way until I tried to get rails
to work within a subdirectory. At this point I''m stuck because although
I can hand craft an url to dispatch.fcgi that works, all the link_to
links do not have the necessary prefix...
I also noticed that relative_url_root is only set for Apache. Is this
the only server that rails will "automatically" support a subdirectory
on?