Welcome Guest | Login

map.connect

I have a working application running under FastCGI in a subfolder.  The primary URL is http://www.biosurplus.net/equip/register/log_in'

I have tried changing the 'routes.rb' file to map a shortcut to this URL:

map.connect '', :controller => :register, :action => :log_in

With the intent being to route requests for http://www.biosurplus.net/equip' to the longer URL.  

This isn't working.  I've also tried to use 'map.root.'

Is the problem related to the fact that the application is running in a subfolder to another app?

Any suggestions would be appreciated.

Thank you!

-AAG

2008-02-28 02:16 PM

Hi there - if you look at the default .htaccess that rails spits out you'll see:
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
#   RewriteCond %{REQUEST_URI} ^/notrails.*
#   RewriteRule .* - [L]
That "notrails" you'll want to do for your equip

then, make sure to add the line;

ActionController::AbstractRequest.relative_url_root = "/equip"

at the bottom of your environment.rb file.

You shouldn't need anything else besides these two fixes.  For more information see:
http://www.hostingrails.com/forums/wiki_thread/6



2008-02-28 07:22 PM

Hi William -

I uncommented the lines:

RewriteCond %{REQUEST_URI} ^/notrails.*
RewriteRule .* - [L]

in my public/.htaccess file.  I also pasted the line

ActionController::AbstractRequest.relative_url_root = "/equip"

to the bottom of my config/environment.rb file.


I restarted the app using 'killall -usr1 dispatch.fcgi'

However, when I go to the URL "http://www.biosurplus.net/equip," I still get an error from the browser.  

I'm also now getting an HTTP 500 error when I try the application's primary URL: http://www.biosurplus.net/equip/register/log_in

I'm going to comment out the changes to restore the main application.  I'd certainly appreciate any recommendations that you might have for getting the shorter URL to work.

Thank you,

-Arlen

2008-02-29 08:21 AM

Hi William -

Should the changes you've suggested be applied to the 'equip' app, which is running in a subfolder, or to the 'bsi' app, which is the main application, running under Mongrel?

-A

2008-02-29 08:35 AM

Arlen -

You should've the lines on your main app's .htaccess file.

2008-02-29 10:37 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!