OK, the system/maintenance.html example can be made to work - simply
by putting it *outside* of the Directory block, in the server config.
There is still an issue where Passenger is sending the *original* uri
to Rails instead of the rewritten one. More examples below:
# in server config, not in Directory
RailsAllowModRewrite on
RewriteEngine On
RewriteRule ^/alice$ %{DOCUMENT_ROOT}/bob
RewriteRule ^/server-status$ - [L,H=server-status]
request /alice
127.0.0.1 - - [15/Apr/2008:11:21:26 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (2) init rewrite engine with requested uri /alice
127.0.0.1 - - [15/Apr/2008:11:21:26 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (3) applying pattern '^/alice$' to uri '/alice'
127.0.0.1 - - [15/Apr/2008:11:21:26 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (2) rewrite '/alice' -> '/Users/jjulian/trunk/
public/bob'
127.0.0.1 - - [15/Apr/2008:11:21:26 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (3) applying pattern '^/server-status$' to uri '/
Users/jjulian/trunk/public/bob'
127.0.0.1 - - [15/Apr/2008:11:21:26 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (2) local path result: /Users/jjulian/trunk/
public/bob
127.0.0.1 - - [15/Apr/2008:11:21:26 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (1) go-ahead with /Users/jjulian/trunk/public/bob
[OK]
yet, Rails gets /alice. I think it should get /bob
[18623:Hooks.cpp:370] Processing HTTP request: /alice
request /server-status
127.0.0.1 - - [15/Apr/2008:11:21:48 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (2) init rewrite engine with requested uri /
server-status
127.0.0.1 - - [15/Apr/2008:11:21:48 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (3) applying pattern '^/alice$' to uri '/server-
status'
127.0.0.1 - - [15/Apr/2008:11:21:48 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (3) applying pattern '^/server-status$' to uri '/
server-status'
127.0.0.1 - - [15/Apr/2008:11:21:48 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (2) remember /server-status to have Content-
handler 'server-status'
127.0.0.1 - - [15/Apr/2008:11:21:48 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (1) pass through /server-status
localhost - - [15/Apr/2008:11:21:48 --0400] [localhost/sid#80bbc0]
[rid#8cd850/initial] (1) force filename /Users/jjulian/trunk/public/
server-status to have the Content-handler 'server-status'
Rails gets this request. I think it should not, since a separate
Content-handler was set on it.
[18624:Hooks.cpp:370] Processing HTTP request: /server-status
On Apr 14, 6:15 pm, Jonathan Julian <
jonathan.m.jul...@gmail.com>