# Multiple Rails Apps in 1 Virtual Host on Apache 1.3

**URL:** <https://www.ruby-forum.com/t/multiple-rails-apps-in-1-virtual-host-on-apache-1-3/52389>\
**Category:** Rails\
**Created:** [January 13, 2006, 3:45pm UTC](https://www.ruby-forum.com/t/multiple-rails-apps-in-1-virtual-host-on-apache-1-3/52389 "2006-01-13T15:45:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Barclay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d2c977/32.png) [@Paul\_Barclay](https://www.ruby-forum.com/u/Paul_Barclay)\
**Post date:** [January 13, 2006, 3:45pm UTC](https://www.ruby-forum.com/t/multiple-rails-apps-in-1-virtual-host-on-apache-1-3/52389/1 "2006-01-13T15:45:04Z")

</div>

After attempting this on my own using the Apache “Alias” directive I  
noticed that it did not work in all cases:

[http://myserver/app1/](http://myserver/app1/) (this worked)  
[http://myserver/app1](http://myserver/app1) (this failed, I won’t bore you with the rewrite  
logs of why)

This led me to the following article  
[http://wiki.rubyonrails.com/rails/pages/HowtoDeployMoreThanOneRailsAppOnOneMachine](http://wiki.rubyonrails.com/rails/pages/HowtoDeployMoreThanOneRailsAppOnOneMachine)

Which I followed.

Must to my sorrow I get the same behaviour as using “Alias”.

I found I can fix this using another rewrite rule:

RewriteRule ^/app1$ /app1/ [r]

I would like to get this working without having to do the redirect, has  
anybody else had this problem?

I am runnig Linux, apache 1.3 and the latest Rails version.

---

<div class="post-metadata">

**Author:** ![Paul\_Barclay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d2c977/32.png) [@Paul\_Barclay](https://www.ruby-forum.com/u/Paul_Barclay)\
**Post date:** [January 13, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/multiple-rails-apps-in-1-virtual-host-on-apache-1-3/52389/2 "2006-01-13T17:34:32Z")

</div>

On Fri, Jan 13, 2006 at 03:45:04PM +0100, Paul Barclay wrote:  
} After attempting this on my own using the Apache “Alias” directive I  
} noticed that it did not work in all cases:  
}  
} [http://myserver/app1/](http://myserver/app1/) (this worked)  
} [http://myserver/app1](http://myserver/app1) (this failed, I won’t bore you with the rewrite  
} logs of why)  
}  
} This led me to the following article  
}  
[Peak Obsession](http://wiki.rubyonrails.com/rails/pages/HowtoDeployMoreThanOneRailsAppOnOneMachine)  
}  
} Which I followed.  
}  
} Must to my sorrow I get the same behaviour as using “Alias”.  
}  
} I found I can fix this using another rewrite rule:  
}  
} RewriteRule ^/app1$ /app1/ [r]  
}  
} I would like to get this working without having to do the redirect,  
has  
} anybody else had this problem?  
}  
} I am runnig Linux, apache 1.3 and the latest Rails version.

Actually, this is exactly what you should do. If you watch what  
webservers  
do when you ask for a directory without the terminal slash, it redirects  
you to the URL with an appended slash. The redirect you are using is  
right  
and proper. Why don’t you like it?

–Greg

---

<div class="post-metadata">

**Author:** ![Paul\_Barclay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d2c977/32.png) [@Paul\_Barclay](https://www.ruby-forum.com/u/Paul_Barclay)\
**Post date:** [January 13, 2006, 5:56pm UTC](https://www.ruby-forum.com/t/multiple-rails-apps-in-1-virtual-host-on-apache-1-3/52389/3 "2006-01-13T17:56:32Z")

</div>

No good reason really…

I just wanted to do it without the redirect to keep my superiors happy  
as they felt the redirect was a bit clumsy.

Thanks for the feedback.
