views:

134

answers:

1

Hello friends, Just wanted to know how we can redirect the subdomain to domain.

I have two domain which in pointing to my rails application and a subdomain

  1. www.xyz.com
  2. www.xyz.info
  3. example.xyz.com

Now when the user access www.xyz.info the example.xyz.com page should open up but the address bar should be www.xyz.info.

So is it possible to redirect?

Thanks Abhi

A: 

One approach should be to use a reverse proxy, using mod_proxy. In the configuration of www.xyz.info put

ProxyPass / http://example.xyz.com/

However, I think it would be much easier to just deploy the rails application twice, i.e. put the configuration that you have in example.xyz.com also into www.xyz.com.

Martin v. Löwis