passenger 3.0.11
apache 2.2
ruby 1.8.7
rails 2.3.14
multiple vhosts running unique rails apps (all using the same versions
above)
I'm trying to add canonical hostname rewrites. When I enable this to
any one of the apps, the rewrite will work for that one site, but then
other sites will end up serving the content of the site having the
rewrite. For example, here's what will happen when I add the rewrite
to the 3rd out of several vhosts.
domain_01 -- fine (IS a rails/passenger site)
domain_02 -- fine (IS a rails/passenger site)
domain_03 -- fine ---------- this one has the rewrite ----------
domain_04 -- fine (not a rails/passenger site)
domain_05 -- redirects to and serves domain_03
domain_06 -- redirects to and serves domain_03
domain_07 -- redirects to and serves domain_03
domain_08 -- fine (not a rails/passenger site)
domain_09 -- fine (not a rails/passenger site)
domain_10 -- fine (IS a rails/passenger site)
domain_11 -- fine (IS a rails/passenger site)
domain_12 -- fine (not a rails/passenger site)
domain_13 -- fine (not a rails/passenger site)
domain_14 -- fine (not a rails/passenger site)
Here's a typical set of directives I'm using:
# for passenger
<Directory "/Sites/ownerX/app_xyz/public">
AllowOverride all
Options -MultiViews
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mysite\.tld [NC]
RewriteRule ^/(.*)
http://www.mysite.tld/$1 [R=301,NS,L]
</IfModule>
I have also tried this a few other variations:
RewriteRule (.*)
http://www.mysite.tld%{REQUEST_URI} [L,NS,R=301]
I've read quite a few related discussions, tried quite a few
variations on the rewrite. By all accounts this should work, and kind
of does, except for this "greedy" vhost thing.
There's no real difference in the vhosts for sites 10 & 11. Not sure
why they're immune.
Of course, I can't say 100% it's passenger related, but it sure feels
related.
I just need some new ideas to investigate. Thanks...