Problem with automatic www redirect

Otávio Serra

Active Member
Apr 27, 2015
33
8
8
Brazil
cPanel Access Level
Root Administrator
I don't know how but one whm account is automatic redirect from no-www to www.

I searched on .htacess from this account and I can't found records that is redirecting it. On cPanel's GUI redirects I can't found records too. But, always when I try to enter in the main domain using browser without www, always it's go to www.domain.ltd . I found what is making this redirect. There are one html file returned on the first request that have one meta in it that redirects to www, but I can't find where I can turn it off.

This is the html returned from server when I'm try to access domain.ltd:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<meta http-equiv="refresh" content=0;url="http://www.domain.ltd">
</head>

<body>

</body>
</html>
Anyone knows where in apache config files this return can be set? Or it's one config that I can set off?

Thanks
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,753
311
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
You should simply remove the Meta refresh line from the HTML file to keep it from redirecting to www.

So remove:

<meta http-equiv="refresh" content=0;url="http://www.domain.ltd">

And save the file.
This should stop it from refreshing to the www version of the site.
 

Otávio Serra

Active Member
Apr 27, 2015
33
8
8
Brazil
cPanel Access Level
Root Administrator
You should simply remove the Meta refresh line from the HTML file to keep it from redirecting to www.

So remove:

<meta http-equiv="refresh" content=0;url="http://www.domain.ltd">

And save the file.
This should stop it from refreshing to the www version of the site.
You didn't understand: on main index.html in root of this domain don't have this meta. The file is other. For some reason apache is delivery this html file with body tag's empty with only one this meta redirect instead of delivery the correct html that are in root of this domain. When I request www.domain.ltd, apache send the correct html file. But when I try to connect using domain.ltd, this incorrect html is returned. I don't know how. Because of this I want to know where I can find this. Do you understand?
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,753
311
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
There are only 2 places it would cause this a redirect.
A redirect/rewrite rule in the .htaccess file.
Or a Meta Refresh in a index.html, .htm, .php etc.. file.

I would check to see if you have any other index.XXX files that may have the refresh in them.
Also I would check and make sure the DNS records for www and non-www are pointed correctly.
Also may need to try clearing browser cache or using another browser you have not visited the site on yet or private tab/window and see if you get the same results.

You should not be editing the httpd config at all with cPanel manually.
 
  • Like
Reactions: cPanelLauren