I just took over the webmaster position in my organization, and I'm trying to set up a development environment separate from the production environment. The two environments are hosted with different companies, both on shared hosting plans.

Right now, production is at domain.com and development is at domain2.com

What I want is to direct my development team to dev.domain.com

More importantly, I don't want the URL to change from dev.domain.com back to domain2.com, but I also be responsive to page changes. For example, if my dev team navigates from dev.domain.com to a page (called "page"), I'd like the URL to show as dev.domain.com/page

Is this possible, or am I just dreaming?

  • What kind of access do you have on dev shared hosting? This is very easy to do. I do it all the time :) I have map of 3 servers 2 shared hosting accounts all interlinked as subdomains.
    – user11237
    Jul 18, 2012 at 13:59

3 Answers 3


Just create a subdomain and point it at a folder in your website.

EG, dev.domain.com can easily map to www.domain.com/developer/ but displays as you require.


Depending on what hosting you have (shared or VPS/Dedicated and therefore access to ISS) you can map or use an alias to do what you're after (AKA masking). This should be fine for development site as you won't be penalized by Google since it's not intended for the public. (Thank you CJK)

  • This involves the developers having access to the production server.
    – cjk
    Jul 18, 2012 at 12:43
  • @cjk - I'm sorry I don't understand the issue or your comment.
    – Dave
    Jul 18, 2012 at 12:47
  • The whole idea of the developers having their own domain is that they can publish and test before pushing to production. Giving them a folder on the live server invovles granting access to a live server. If you are working with anything that requires any security, this is a big no-no.
    – cjk
    Jul 18, 2012 at 12:49
  • Ah, sorry, I didn't read the original. I am going to make an edit
    – Dave
    Jul 18, 2012 at 12:50

If I understand your problem correctly.

You will need access to Domain.com's DNS. In Domain.com's DNS, create a A (Host) record that points to domain2.com's IP address and name it dev. Once it's propagated you should be able to go to dev.domain.com which will be your dev site.

Good luck!

  • I tried that already; because domain2.com is on a shared hosting plan, trying to do it with A records gives me 404 errors Jul 7, 2012 at 0:47
  • @JasonBaker What does shared hosting have to do with your A record?
    – Su'
    Jul 7, 2012 at 8:49
  • Unless I'm making a dumb mistake, it means that I don't have a unique IP address. When I enter the IP I get by pinging domain2.com into an A record for dev.domain.com, going to dev.domain.com sends me to a generic 404 page, propbably because the DNS server for domain.com doesn't know how to resolve the shared IP Jul 7, 2012 at 18:53
  • You get 404 because dev server doesn't know you are pointing subdomain to it.
    – user11237
    Jul 18, 2012 at 14:01

What you have to do is this:

Since you are on shared hosting, I assume you have cpanel.

  1. Go to production server cpanel
  2. Advanced DNS zone edit
  3. Add new entry dev.domain.com A record -> IP
  4. Go to dev server cpanel
  5. Addon domain and insert subdomain

You are getting 404 because you are missing 5th step. Since server doesn't auto-magically know you are pointing domain to it.

I'm not sure adding subdomain as addon under cpanel will work. It would be easier on dedicated box as you would setup virtual host. But I don't see why it should not work.

  • @JasonBaker glad it worked out for you :)
    – user11237
    Jul 20, 2012 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.