# URL issue localhost/mongrel vs remote-server/apache

**URL:** <https://www.ruby-forum.com/t/url-issue-localhost-mongrel-vs-remote-server-apache/164810>\
**Category:** Rails\
**Created:** [April 6, 2009, 9:23am UTC](https://www.ruby-forum.com/t/url-issue-localhost-mongrel-vs-remote-server-apache/164810 "2009-04-06T09:23:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [April 6, 2009, 9:23am UTC](https://www.ruby-forum.com/t/url-issue-localhost-mongrel-vs-remote-server-apache/164810/1 "2009-04-06T09:23:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [April 6, 2009, 9:58am UTC](https://www.ruby-forum.com/t/url-issue-localhost-mongrel-vs-remote-server-apache/164810/2 "2009-04-06T09:58:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [April 6, 2009, 3:07pm UTC](https://www.ruby-forum.com/t/url-issue-localhost-mongrel-vs-remote-server-apache/164810/3 "2009-04-06T15:07:51Z")

</div>

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
