I have e.g www.example.com as my website domain, and now as testing instance I want to add www.staging.example.com. How this can be achieved. I tried searching for solutions on google, but got confused. Any suggestions on this will be greatly appreciated.
Asked
Active
Viewed 827 times
1 Answers
1
Your first line of attack would be to create a new DNS record for the domain you want. This can usually be done from the control panel provided by the service/company you purchased the domain through.
If your staging server is hosted and available at the ip A.B.C.D for example, you'd create a new A record for www.staging that points to A.B.C.D
Once this is done, you'll want to add a new (v)host entry on your server that's housing the staging site (this differs whether you're using Apache, NGINX etc). A simple Google search on how to do this should suffice.

Speedy
- 467
- 1
- 6
- 16
-
Thanks for quick reply, I know it can be done from cpanel, do u know how to do it through ssh. – Sonalkumar sute Jul 25 '16 at 06:24
-
Hello. Server-side decision is at nginx config for your virtual host. Something like `server_name www.staging.example.com` at `server` block, and linked to your application server upstream. But anyway you should configure your DNS settings for domain(s). – cnnr Jul 25 '16 at 07:28