[BlueOnyx:00550] Re: Curious re-direct behavior when creating a site www.foo.com that already exists

Michael Stauber mstauber at blueonyx.it
Wed Feb 18 08:28:32 -05 2009


Hi Jeff,

> When I create the new site in BO - and I call this site 'www.foo.com'
> - even though I have not restored over any files for it yet - if I
> change my local hosts file so that www.foo.com now points to the new
> BO box - BO somehow still redirects me to the BQ 'live' site.
>
> To get it to work, have to change the site domain to bo.foo.com.

Yeah, remember that it's name based hosting. So when you point your browser to 
www.foo.com your browser resolves what IP that site runs on by querying the 
DNS records. Your browser then connects to that IP and tells the Apache there: 
"Yoo, slacker, show me the webpage for www.foo.com!"

The Apache then checks "Do I host a www.foo.com?" and if it finds it, it'll 
serve the corresponding webpage(s).

Depending on where your DNS points to and depending on how the site is named 
on the new server you may not end up looking at page you wanted to see, 
because your DNS still points to the "old box".

As a work around you could set up the DNS for the new site on BlueOnyx on that 
BlueOnyx server and configure your workstation to use the BlueOnyx DNS server 
for resolving DNS. That way you can test your migrated site before you "go 
live" with it.

Alternatively: If www.foo.com runs on an IP different from the server's IP 
*and* it's the only site on that IP, then you can simply point your browser to 
that IP and should be able to see the webpage.

-- 
With best regards

Michael Stauber




More information about the Blueonyx mailing list