Avatar of rolando montalvo
rolando montalvo
 asked on

www redirects to non www on any browser

Windows Server 2008 SP2
DC - DNS Server
DNS Manager has A record for www to point to an external IP
DNS Manager has A record for non www to point to internal IP
DOMAIN.COM is also the domain used for AD ( i know it shouldnt have been, we will look to change in the future)
WWW.domain.com is a external host, works when your outside the office.
IIS 7 is installed, already uninstalled and reinstalled
Host File is empty. Have tried adding external ip  www.domain.com but still didnt work.
Ping to www.domain.com shows the external IP. Nslookup www.domain.com shows the public IP.
3 Browsers, cleared history

When you type http://www.domain.com, the address bar redirects and shows http://domain.com and opens the IIS homepage. Cant figure out where on the server setting is making the http://www.domain.com redirect to http://domain.com.
DNS

Avatar of undefined
Last Comment
footech

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
footech

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rolando montalvo

ASKER
Wow. I didnt even realize it when I was testing it externally. Thank you.
DrDave242

Footech is right; it has to be changed on the site.

Specifically, there's an HTTP redirect present on that site. When a browser hits http://www.domain.com, the site returns a response with a status code beginning with a 3. Code 301 is probably the most common, as it represent a permanent redirection. The response also includes the target of the redirection - i.e., where the site resides now. In your case, that target is http://domain.com.

The browser then sends a new request to the redirection target. That's why you can see the URL change in the address bar, and that's why it doesn't work from inside a domain that's named domain.com, because that name will (by design) resolve to the IP addresses of the domain controllers.

Depending on the web host, it might be very easy to get them to remove the HTTP redirect, or it might be a big pain. Unfortunately, there's no other way to get it to work, aside from renaming the AD domain.
footech

@rolando - Thanks for closing the question.  Personally I would have split points with DrDave242 as I think he added enough extra useful info.
Your help has saved me hundreds of hours of internet surfing.
fblack61