-2

I want to redirect a main domain to a subdomain for example www.abc.com to xyz.test.com. Whenever i type www.abc.com it should be redirect to xyz.test.com. Both domain are hosted on same server.

Subdomain xyz.test.com is not a virtual host of web server (i.e. apache & nginx) it is code generated website and you can directly access it via http://xyz.test.com. I'm using apache and nginx both so whatever best fit i will use. Any help would be appreciated.

Thank You :)

Shoaib
  • 1
  • 1
  • 4

1 Answers1

0

I have resolved this by changing apache virtual host config to following,

<VirtualHost *:80>
        ServerName  www.abc.com
        ProxyPass / http://xyz.test.com/
        ProxyPassReverse / http://xyz.test.com/
</VirtualHost>

now when i open www.abc.com it shows webpage from xyz.test.com

Shoaib
  • 1
  • 1
  • 4