Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  Sandro Dzneladze Jul 18 '12 at 13:59
add comment

3 Answers

up vote 0 down vote accepted

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.

share|improve this answer
    
Looks like it worked; thank you! –  Jason Baker Jul 19 '12 at 17:07
    
@JasonBaker glad it worked out for you :) –  Sandro Dzneladze Jul 20 '12 at 12:51
add comment

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.

EDIT

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)

share|improve this answer
    
This involves the developers having access to the production server. –  cjk Jul 18 '12 at 12:43
    
@cjk - I'm sorry I don't understand the issue or your comment. –  Dave Rook Jul 18 '12 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 '12 at 12:49
    
Ah, sorry, I didn't read the original. I am going to make an edit –  Dave Rook Jul 18 '12 at 12:50
add comment

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!

share|improve this answer
    
I tried that already; because domain2.com is on a shared hosting plan, trying to do it with A records gives me 404 errors –  Jason Baker Jul 7 '12 at 0:47
    
@JasonBaker What does shared hosting have to do with your A record? –  Su' Jul 7 '12 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 –  Jason Baker Jul 7 '12 at 18:53
    
You get 404 because dev server doesn't know you are pointing subdomain to it. –  Sandro Dzneladze Jul 18 '12 at 14:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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