Sure, my initial thought was that the rule was broken.
But I tried several different ones before just giving up and asking
here. Do you (or does anyone) have an idea of a rule that could work?
In any case, just to be clear, this is how I’d like it to work:
www.myapp.com
points to an Apache server and is rewritten to a load balance cluster
(and this does work, rewrite and all).
In addition to that, I’d like a second (and later on a third),
seperate rails application to run at
www.myapp.com/service/
and to be rewritten to another cluster.
The reason why I ‘need’ a new application is that the /service/
application is encoded with Latin1 and connects to a pre-existing
Interbase db, whereas the root application is encoded with UTF-8 and
connects to MySQL.
/service/ is closely related to the root application, with the same
basic layout for the view, and I’d like it to appear as an integral
part of the site. I can always use subdomains, but I’d rather not.
Here’s the contents of my vhost when it works fine, before adding
anything to do with the /service/ rewrite and cluster:
<VirtualHost *:80>
ServerName myapp.com
ServerAlias www.myapp.com
ServerAlias myapp
DocumentRoot “C:/dev/server/myapp/public”
# ProxyPass / http://localhost:4000/
# ProxyPassReverse / http://localhost:4000
# ProxyPreserveHost on
<Directory “C:/dev/server/myapp/public”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^vmyapp.com$ [NC]
RewriteRule ^(.)$ http://www.myapp.com$1 [R=301,L]
RewriteRule ^/$ /index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.)$ balancer://myapp_cluster%{REQUEST_URI} [P,QSA,L]
AddOutputFilterByType DEFLATE text/html text/plain text/xml
application/xml application/xhtml+xml text/javascript text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
ErrorLog logs/myapp_errors_log
CustomLog logs/myapp_log combined
<Proxy balancer://myapp_cluster>
BalancerMember http://localhost:4000
BalancerMember http://localhost:4001
BalancerMember http://localhost:4002
Thanks,