1

Centos cPanel server - Apache/PHP.

Why is this happening? Can I can change the server configuration to guarantee regular users don't get this error? It is a production server for an e-commerce website and this error might lose us money.

I type "example.com" into the address bar and am "redirected" to "example.com/cgi-sys/defaultwebpage.cgi" which displays generic information about cPanel and Apache. It occurs in Google Chrome but not in Firefox, and it only occurs with the base url "example.com" (and "www.example.com"). "example.com/path/to/file.php" works. Even "example.com/index.php" works.

When I checked the server log and found lines like (fake ip address and base url):

123.99.99.99 - - [08/Jan/2013:20:37:32 -0800] "GET /cgi-sys/defaultwebpage.cgi HTTP/1.1" 200 3477 "http://example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"

I flushed the dns. I cleared the Chrome DNS cache here: chrome://net-internals/#dns

Again, what is causing this, and can I prevent it serverside?


Thanks for the answer. I edited the file and added this right after the opening tag:

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.example.com">

I found the file in cpanel thanks to this stackoverflow question: change default page in cpanel.

To quote: it's in WHM>> Main >> Account Functions >> Web Template Editor.

I just searched "Web Template" and found it.

Buttle Butkus
  • 1,741
  • 8
  • 33
  • 45

2 Answers2

4

It's not a DNS issue, browsers tend to cache the default redirect from cpanel quite long and persistently (sadly it's a html refresh, "<html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=/cgi-sys/defaultwebpage.cgi"></head><body></body></html>"). Did you also clear the regular browser cache from chrome, or tried with a private browsing window? "example.com/path/to/file.php" works because you probably didn't visit that URL before the site was properly set up in cpanel.

arjarj
  • 3,101
  • 1
  • 17
  • 10
  • Thanks, I guess it was the regular cache after all. But I have no idea why I ever arrived at that page in the first place. Do you know why it would be served in the first place? Should I put a redirect on that page so that any other users will not have the same result? – Buttle Butkus Jan 09 '13 at 06:31
  • If it's working in "fresh" browsers right now, everything should be fine. It usually means you visited that domain while it was already pointing to the cpanel server, but the cpanel server was not yet configured with that domain (it was not parked or used for an account). Cpanel then shows this redirect page. You could consider replacing the default cpanel placeholder with something more sensible without a redirect. That way it might still be cached for a while, but then at least a refresh from the browser will get the new content. – arjarj Jan 09 '13 at 06:35
  • I tried typing in "example.com" and pressing ctrl-F5 repeatedly though and did not get any change. I've never had Chrome be so stubborn. Why not use the redirect, as I have in the solution I added to the question? – Buttle Butkus Jan 09 '13 at 06:42
  • 1
    Once you get to press ctrl-F5, it's already too late. The redirect will already be read from cache and executed, so you'll end up refreshing the redirect target. It's the same with cached 301 responses really. – arjarj Jan 09 '13 at 08:39
2

I ran into Chrome aggressive caching slapping me into /cgi-sys/defaultwebpage.cgi after I re-wrote my site and moved it to a new server. Adding a META tag doesn't work because Chrome never gets that far-it's reading from its cache an earlier redirect.

I solved this by adding a 301 redirect to my .htaccess with this line:

Redirect 301 /cgi-sys/defaultwebpage.cgi /index.html

I'm not sure what my original site was developed with but my new site is a Jekyll-generated static site.

benWoz
  • 21
  • 3