views:

19

answers:

0

Hi All,

I've setup my rails app in ~/rails_apps/testapp.

I've got it running on port 12004 (there are some issues with mongrel, but i've got it running now so that's sorted i believe).

I've set up the following in my ~/public_html/.htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com.au$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com.au$
RewriteRule ^.*$ "http\:\/\/127\.0\.0\.1\:12004%{REQUEST_URI}" [P,QSA,L]

Now when i access www.mysite.com.au it goes to the index page set by my rails app EXCEPT that any static files rails accesses, e.g. stylesheets, images, etc. in the ~/rails_apps/testapp/public directory can't be seen.

This error is given in the mongrel log:

ActionController::RoutingError (No route matches "/stylesheets/master.css")

what i then did was set the rails environmental variable:

ENV['RAILS_RELATIVE_URL_ROOT'] = '/mysite'

I created the following folder ~/public_html/mysite and symlinked it to ~/rails_apps/testapp/public. Assuming that the base root of my webserver was ~/public_html and that by adding the "/mysite" to the rails environment.rb file it'd now look in "/public_html/mysite/" for all static files...

But it still reports this in the mongrel log:

ActionController::RoutingError (No route matches "/mysite/stylesheets/master.css"):

Any thoughts? I think i've just got the wrong understanding of the rewrite combined with where rails is looking?

Thanks, Chris