Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using wordpress on hostgator and for some reason root domain is directing to apparently different code to the www subdomain.

That is to say, this:

is producing different html to:

Yet they both (seem) to point to (I'm fuzzy on how to check this in cPanel though):


I've sought and destroyed all the caches I could find.

I've left it 12 hours in case it was the host's caching -- but if it is nothing's flushed yet.

It's on a shared account on hostgator.

Any ideas for tests/checks?

share|improve this question
What's the difference in the code? – slhck Mar 11 '13 at 8:07
Some hosts offer caches that have (way too long) a retention. Try adding a GET variable to your url, like – BloodPhilia Mar 11 '13 at 8:12
Are you 100% certain the code is the same? Also, delete your cache/browser history etc (if convenient to do so) and see if the same error persists. – Dave Mar 11 '13 at 8:59

"www" is a sub-domain which may (or may not) point to the same address your (second-level) domain points to. I seem to recall it is possible to configure redirections from within cpanel, so what you need to do is redirect www.domain.tld to domain.tld (or vice versa, depending on which one displays the "correct" html). Better still you might want to do some reading on DNS and spend some time to understand what's the purpose of the different resource records (RRs), especially the A record.

If you're running linux (or if you've got cygwin) you can always install the dnsutils package, which provides dig, which in turn is a very nice command line utility that helps you retrieve any RR for any domain you want. Or you can use one of the many online dig tools out here, e.g.'s.

share|improve this answer
You can manage subdomains in cpanel:, but mucking with this only caused redirection loops in the above case. – Williams Mar 13 '13 at 3:06
up vote 0 down vote accepted

Turns out the problem was in something that was an default set-up rewrite rule in the .htaccess. I should set up the rewrite in the .htaccess regardless.

Thanks for the great comments! ?flush=me is a nice tip.

To be sure to be sure I removed offending cruft added the a rewrite rule to permanently redirect from non-www to www:

# Redirect to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

ps. I never used to appreciate the law about either having www or not and just used to lazily set up both. But a few times recently I've had my arse seriously kicked by having the 2 different sessions that are created and the confusion caused therein. I appreciate the law about have a 1 cardinal URL only now. www or not: pick only one.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .