0

I have a production website, and a development website. The must be accessed through the domain name, www.mysite.com. I would like to be able to access the dev site through a praticular port, say 65432. So www.mysite.com:65432 would take me to the dev site, while www.mysite.com would take me to the production site.

Any suggestions? I'm interested in both linux and windows solutions. I cannot edit the configuration of the site itself, so I can only try to change routing, port forwarding, dns masking, etc.

3
  • This is trivially done in a webserver's configuration. I can't imagine a situation where you can't add a virtualhost but you're allowed to change routing, ports, and DNS. Is this just a "fun" hypothetical situation?
    – ceejayoz
    Apr 23, 2015 at 0:59
  • This makes little sense to me. On what ip address, port, and hostname is your dev site currently listening?
    – Bandrami
    Apr 23, 2015 at 5:43
  • Unfortunately, not hypothetical. mysite.com:65432 is accessed by VPN. When connected a hosts entry is added: 1.2.3.4 mysite.com Then, I can access mysite.com at port 65432. I don't have access to the website configuration. So my though was, if I could do something smart enough that all routing on 65432 would set mysite.com to 1.2.3.4 and when not on 65432, mysite.com would point to the regular dns address, and then by default use port 80. Hope this makes more sense.
    – user979989
    Apr 24, 2015 at 22:39

1 Answer 1

0

If you use same website name you will get same IP to connect to. You can use iptables to change the destination IP from IP1 to IP2 (dev server) on port condition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .