Clicking on the former loads a webpage - clicking on the latter does not. My question is... why?

Per this tool, they both have the same A records - 209.189.226.66.

Also, both are valid Virtual Hosts as the following demonstrates:

<?php
$fsock = fsockopen('www.texasladiesaside.org', 80);

fputs($fsock, "GET / HTTP/1.1\r\n");
fputs($fsock, "Host: www.texasladiesaside.com\r\n\r\n");

while (!feof($fsock))
{
	echo fgets($fsock, 1024);
}

So my question is... why isn't showing me the same thing as ?

Dani AI

Generated

Short answer: because the server chooses which site to serve by the Host header, and already proved that the webserver will serve the .com name when it actually receives that Host header. That means the Apache/config side can work — the remaining likely causes are DNS (clients getting a different IP for the .com name), registrar/parking/forwarding in front of the host, a caching/resolver issue, or an intervening proxy/CDN or HTTPS/SNI mismatch.

Useful checks to run from a machine that sees the problem:

# what public resolvers return for the hostname
dig +short www.texasladiesaside.com @8.8.8.8
dig +trace   www.texasladiesaside.com

# force a request to the server IP but tell the server the Host you want
curl -I -H "Host: www.texasladiesaside.com" http://209.189.226.66/

# alternative: force curl to resolve the name to the IP locally
curl -v --resolve www.texasladiesaside.com:80:209.189.226.66 http://www.texasladiesaside.com/

# if HTTPS is involved, check the cert/SNI
openssl s_client -connect 209.189.226.66:443 -servername www.texasladiesaside.com

What to look for and next steps: compare answers from several public resolvers (8.8.8.8, 1.1.1.1) and the authoritative nameservers; if any resolver returns a different IP then fix the zone at the authoritative NS or update registrar glue. Verify there is an explicit www A or CNAME record (apex and www are separate). Flush local DNS/browser caches after changes. If HTTPS is used, ensure the certificate covers both hostnames (SAN) and that SNI works.

As suggested, the long-term fixes are to make the server authoritative for both names (add both names to the vhost) or do a 301 redirect so one canonical name is used.

Recommended Answers

All 4 Replies

virtual hosts are in httpd.conf, do you have that properly set up?

Yes - that was the reason I included the PHP code - to demonstrate that the virtual hosts are correctly setup. If you change the .com domain in the script to digg.com, it won't work as no virtual hosts have been setup for digg.com.

well, there are two ways to do that - either place the site in the default root virtual host (bad idea) or set up two different v-hosts for the two domains, pointing to the same place in the filesystem

oh, another way is to use mod_rewrite to redirect one of the domains to the other

mod_rewrite would require I have two accounts (one for each website) instead of just one.

Regardless, the issue has been resolved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.