# How to create a rails apps for multiple domain to access?

**URL:** <https://www.ruby-forum.com/t/how-to-create-a-rails-apps-for-multiple-domain-to-access/179680>\
**Category:** Rails\
**Created:** [December 1, 2009, 7:43pm UTC](https://www.ruby-forum.com/t/how-to-create-a-rails-apps-for-multiple-domain-to-access/179680 "2009-12-01T19:43:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![plastik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@plastik77](https://www.ruby-forum.com/u/plastik77)\
**Post date:** [December 1, 2009, 7:43pm UTC](https://www.ruby-forum.com/t/how-to-create-a-rails-apps-for-multiple-domain-to-access/179680/1 "2009-12-01T19:43:33Z")

</div>

I have a project here on DIY website.

There is a big problem around is; How do i allow a single rails apps to  
access by multiple domain? where the info for domain will be store  
together with users in the databases.

eg,

RAILS APPS ----- [www.example.com](http://www.example.com)  
|-- [www.sample.com](http://www.sample.com)

---

<div class="post-metadata">

**Author:** ![plastik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@plastik77](https://www.ruby-forum.com/u/plastik77)\
**Post date:** [December 1, 2009, 11:55pm UTC](https://www.ruby-forum.com/t/how-to-create-a-rails-apps-for-multiple-domain-to-access/179680/2 "2009-12-01T23:55:50Z")

</div>

Nicky Cheng wrote:

> I have a project here on DIY website.
> 
> There is a big problem around is; How do i allow a single rails apps to  
> access by multiple domain? where the info for domain will be store  
> together with users in the databases.
> 
> eg,
> 
> RAILS APPS ----- [www.example.com](http://www.example.com)  
> |-- [www.sample.com](http://www.sample.com)

This is a hosting question rather than a Rails question and there are  
many ways to do this.

When you set up your rails app on your host you typically sym link your  
domains public\_html yo your app/public folder

You may have to do some other stuff like setting httpd.conf file  
settings or .htacces settings depending on whether or not you are using  
passenger and depending on your host setup.

Once you’ve got your app hosted you can the point other sub domains in  
exactly the same way.  
If you have top level domains you can use your domain registrars control  
panel to forward a domain to the domain name of your app or you can  
transfer the domain to your host and have the public\_html folder sym  
linked to your app’s public folder in the same way as you set up your  
main domain.

You will really need to talk to your host about the finer details of how  
this should be set up
