On Fri, 2009-08-21 at 16:47 +1200, Phill Coxon wrote: > I have no idea if this is possible so thought I'd ask those for more > knowledgeable here. > > I'm doing some work on a client website. I've set up a virtual site > locally using apache 2 so that I can have a mirror copy of the site to > make changes and test before uploading to the live site. > > At the moment I'm switching between the local and remote sites by > editing the IP address in /etc/hosts. > > What I'd like to know is if there is any way to set up local dns so that > I can resolve "examplesite.com" to either my local virtual site, or the > real live site based on the specified http port. > > i.e.: > > If I visit examplesite.com (standard port 80) I'll go to the live > interent site. > > But if I visit examplesite.com:81 I'll be redirected to the local > development virtual site running on my local computer. > > Probably can't be done but thought I'd ask and see what suggestions you > guys can come up with. > Is the remote host using Name based virtualisation? If not, then you can just forward to the remote site directly from the alternate port using it's IP address ( .htaccess, http.conf, <? header ( 'location: ' ): ?>, etc )
What I have set up for a web design agency in the past was to use http://the.site.im.developing resolving correctly for the live site and http://the.site.im.developing.localsite for the development copy - easy enough for them to swap back and forth. hth, Steve -- Steve Holdoway <[email protected]> http://www.greengecko.co.nz MSN: [email protected] GPG Fingerprint = B337 828D 03E1 4F11 CB90 853C C8AB AF04 EF68 52E0
signature.asc
Description: This is a digitally signed message part
