Why does www.example.com differ from example.com?

0

I tried redirecting in the "head" section, but what I got was a flickering screen. I wish to have the www.redirect to the "clean" URL. How do I do so without the flickering (which I take is redirecting run amok.)

greenber

Posted 2015-12-27T16:27:02.283

Reputation: 523

2How does your question title relate to your question? Because I don’t see it. – Daniel B – 2015-12-27T18:03:18.363

According to the domain names you gave in comments earlier, they are both configured to point to the same IP Address via an A record. Which suggests that this is a server misconfiguration. You need to edit your question to explain what you are serving the pages with and how it is configured. – Michael B – 2015-12-29T10:06:05.923

Answers

0

The difference is because www. is not part of the main domain. www. is called a subdomain.

This means that on your website, you'll have to make sure the subdomain www. points to the same folder as your main domain does. With this, you won't need any redirection, and both will be the exact same.

LPChip

Posted 2015-12-27T16:27:02.283

Reputation: 42 190

The www is not a subdomain; it is the hostname. See this answer on [sf]: http://serverfault.com/a/269840/324849

– Ron Maupin – 2015-12-27T17:46:35.540

@RonMaupin Of course www. is a subdomain. Just because most server configurations allow www. to work as well as without doesn't mean it suddenly is not a subdomain. A FQDN consists of protocol://subdomain.domain.extension – LPChip – 2015-12-27T18:27:29.973

1The www is the hostname, example.com is the domain name, and www.example.com is the FQDN. I have no idea where you get that www is a subdomain. If you have anything to back up your position, please edit your question to include it and add a link to it. – Ron Maupin – 2015-12-27T18:27:43.667

I don't care how many angels can dance on the head of a domain! :-) Just how to get them pointing to same index.asp as uploaded by DreamWeaver. – greenber – 2015-12-27T18:54:20.000

(Just as a concrete example, this site -- under construction -- shows two different pages: http://www.nhtf.net and http://nhtf.net ) See what I mean

|

– greenber – 2015-12-27T19:24:37.450

1

@RonMaupin : This backs up LPChip's position: Wikipedia's page for "Domain name" says "www is a label to create www.example.com, a subdomain of example.com."... "A hostname is a domain name that has at least one associated IP address. For example, the domain names www.example.com and example.com are also hostnames, whereas the com domain is not." If you're taking the position that "www.example.com" is a subdomain but "www." is not, then you're squabbling over the technical interpretation of a recognized abbreviation.

– TOOGAM – 2015-12-30T16:07:25.083

@TOOGAM, I didn't write that www.example.com is a subdomain; I wrote that it is a FQDN. The protocol:// is not actually part of the name, that is a browser feature; other applications don't need that. – Ron Maupin – 2015-12-30T16:26:09.237

0

How are you redirecting in the "head" section of your HTML code? Are you using "refresh", e.g., something like <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://example.com/index.html"> (having a value greater than 0 indicates you wish to have a delay of x seconds before the browser refreshes the page) or are you using a 301 redirect as noted at Will putting the HTML from a 301 redirect page into a document perform the same function as a real 301 redirect? or something else? If you are using an Apache web server and can edit httpd.conf you can make www.example.com an alias for example.com. E.g., by putting the following in a VirtualHost section for the domain name and then restarting the Apache web server software with apachectl restart:

ServerName example.com
ServerAlias www.example.com

It won't change the URL, but they will both point to the same document root. If you want to rewrite the URL, another option, if you are using Apache for the web server, is to see the explanation offered for the question Changing www to point to non-www, instead of the opposite, using .htaccess at another Stack Exchange site, webmasters.stackexchange.com.

moonpoint

Posted 2015-12-27T16:27:02.283

Reputation: 4 432

0

Well, it appears this is a local problem,and only with Chrome: two tabs one with www. and without in IE doesn't show the prob but does in Chrome but only on this machine -- maybe a caching prob? Oh well this is quite literally my problem to solve. Thank you everyone!!

greenber

Posted 2015-12-27T16:27:02.283

Reputation: 523