URL issue localhost/mongrel vs remote-server/apache


#1

Hi all

I have a small issue I ma trying to solve (at least to understand…)

I am testing an app on my remote_server (w Apache/Passenger) in a
sub_URI, without any problem (I tested also the same app, locally w
Apache too)
in my environment.rb , I have initialized
config.action_controller.relative_url_root = “/my_subURI”
config.action_controller.asset_host = "http://my_domain.com

running fine. I am also using a facebox plugin, in which 2 images :
loading.gif and closelabel.gif are hard-coded (I know it should not
be… but I am not the author…), so in the facebox.js , I had to
modify the hard-coded URI
$.extend($.facebox, {
settings: {
loadingImage : ‘/my_subURIv/images/facebox/loading.gif’,
closeImage : ‘/my_subURI/images/facebox/closelabel.gif’,

without this modification, the images where not found… (don’t
understand why …)

the issue is now when running local in development/test, using
Mongrel, teh app is running fine too, EXCEPTED these 2 images : I got
the message when displaying the facebox form

ActionController::RoutingError (No route matches “/images/facebox/
closelabel.gif” with {:method=>:get}):

I don’t know if there is any possibility to avoid this issue, testing
the host (localhost) and changing the environment definition only when
running on localhost ? or any other trick ???

thanks for any ino or link on this kind of issue

erwin


#2

one solution could be not modifying the facebox js URIs, keeping as
it :

  loadingImage : '/images/facebox/loading.gif',
  closeImage   : '/images/facebox/closelabel.gif',

which presently raises an error when running w Apache-passenger (no
subURI) and

just rewriting all http://my_domain.com/images/ TO
http://my_domain.com/my_subURI/images

is that a trick or the solution ? (in which case, not being an
Apache’s guru … how should I rewrite it in an .htaccess

any enlightments ?

erwin


#3

I discover the prefix option for Mongrel …

so starting on localhost

script/server -u -P /my_subURI

is the trick… then it’s running as w Apache-passenger …

erwin