Ignore:
Timestamp:
Jul 17, 2012, 7:04:04 PM (10 years ago)
Author:
glasgall
Message:
Make Rails apps work when accessed via a hostname

Right now accessing a rails app by anything besides
lockername.scripts.mit.edu/appname is broken. Fix this by removing the
RewriteBase directives from the app's .htaccess files and adding a
mapping from "/" to the app to the app's Rack::URLMap.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/locker-dev/locker/deploy/bin/rails

    r2259 r2260  
    8484#   ErrorDocument 500 /500.html
    8585
    86 RewriteBase /$addrend/public/
    8786EOF
    8887
     
    9190RewriteEngine On
    9291RewriteRule ^(.*)\$ public/\$1 [QSA,L]
    93 RewriteBase /$addrend/
     92
    9493EOF
    9594
     
    152151
    153152  begin
    154     Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Rack::URLMap.new("/$appdir" => ${appclass}::Application))
     153    Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Rack::URLMap.new("/$appdir" => ${appclass}::Application,
     154                                                                           "/" => ${appclass}::Application))
    155155  rescue => e
    156156   dispatch_logger.error(e)
Note: See TracChangeset for help on using the changeset viewer.