Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
In IE6, using mydomain.com does not work without www (page not found) but works in Firefox 2 just fine with or without www. It works with www in IE6. How do I fix this?
Code:
<VirtualHost xxx>
ServerAlias domain.com
ServerAdmin [email protected]
DocumentRoot /home/user/public_html
BytesLog domlogs/domain.com-bytes_log
User user
Group user
<IfModule mod_php4.c>
php_admin_value open_basedir "/home/user/:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/user/:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
ServerName www.domain.com

<IfModule mod_userdir.c>
  Userdir disabled
  Userdir enabled user
</IfModule>

User user
Group user
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/
</VirtualHost>
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
cPanel Access Level
Root Administrator
Change:
ServerAlias domain.com
to
ServerAlias domain.com www.domain.com

and then restart apache.

Moreove, make sure CNAME or A record exists in the DNS zone of the domain name.
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
That didn't fix it and cname is there.

Code:
; cPanel 10
; Zone file for domain.com
$TTL 14400
@      86400    IN      SOA     ns1.host.com. root.host.host.com. ( 2006081302 ; serial, todays date+todays
                86400           ; refresh, seconds
                7200            ; retry, seconds
                3600000         ; expire, seconds
                86400 )         ; minimum, seconds

domain.com. 86400 IN NS ns1.host.com.
domain.com. 86400 IN NS ns2.host.com.

domain.com. IN A  xxx.232.68.3

localhost.domain.com. IN A 127.0.0.1

domain.com. IN MX 0 domain.com.

mail IN CNAME domain.com.
www IN CNAME domain.com.
ftp IN A  xxx.232.68.3

domain.com. IN TXT "v=spf1 include:optonline.net ~all"
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
cPanel Access Level
Root Administrator
Check the domain name using dnsreport: http://dnsreport.com

Also, dig the nameservers of the domain name see if they answer correctly. In ssh run:

#dig @ns1.host.com cname domain.com

#dig @ns2.host.com cname domain.com
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
[email protected] [~]# dig @ns1.host.com cname domain.com

; <<>> DiG 9.2.4 <<>> @ns1.host.com cname domain.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19194
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.com. IN CNAME

;; AUTHORITY SECTION:
domain.com. 86400 IN SOA ns1.host.com. root.host.host.com. 2006081302 86400 7200 3600000 86400

;; Query time: 28 msec
;; SERVER: xxx.232.67.3#53(xxx.232.67.3)
;; WHEN: Tue Nov 21 10:41:58 2006
;; MSG SIZE rcvd: 111

[email protected] [~]# dig @ns2.host.com cname domain.com

; <<>> DiG 9.2.4 <<>> @ns2.host.com cname domain.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42535
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.com. IN CNAME

;; AUTHORITY SECTION:
domain.com. 86400 IN SOA ns1.host.com. root.host.host.com. 2006081302 86400 7200 3600000 86400

;; Query time: 0 msec
;; SERVER: xxx.232.67.3#53(xxx.232.67.3)
;; WHEN: Tue Nov 21 10:42:07 2006
;; MSG SIZE rcvd: 111

dnsreport.com shows fine results too. Like I said, it works fine in Firefox without www, but not in IE or Opera.
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
cPanel Access Level
Root Administrator
But according to the output of DIG the nameservers don't know anything about www.domain.com.

The correct answer must be something like:

# dig @ns1.mydomain.com cname www.mydomain.com

; <<>> DiG 9.2.4 <<>> @ns1.mydomain.com cname www.mydomain.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49343
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.mydomain.com. IN CNAME

;; ANSWER SECTION:
www.mydomain.com. 14400 IN CNAME mydomain.com.

;; AUTHORITY SECTION:
mydomain.com. 14400 IN NS ns1.mydomain.com.
mydomain.com. 14400 IN NS ns2.mydomain.com.

;; ADDITIONAL SECTION:
ns1.mydomain.com. 14400 IN A xxx.xxx.xxx.xxx
ns2.mydomain.com. 14400 IN A xxx.xxx.xxx.xxx

;; Query time: 1 msec
;; SERVER: XXX.XXX.XXX.XXX#53(ns1.mydomain.com)
;; WHEN: Tue Nov 21 16:43:06 2006
;; MSG SIZE rcvd: 116
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
I don't know why but I did give you a copy of the dns zone which shows the cname for www / domain. What should I do?
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
cPanel Access Level
Root Administrator
I think you just need to restart named to reload all DNS zones and then run:

#dig @localhost www.domain.com

in sh of your DNS servers. In this case you should get good responses. Sure, it could take a few minutes to reload all zones.
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
In Opera

domain.com automatically shows http://www.domain
(notice no .com in the end, and its a 404)

In IE6 and IE7...it automatically redircects me to Live search engine with results for domain.com as if I were doing a search for domain.com
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
[email protected] [~]# dig @localhost www.domain.com

; <<>> DiG 9.2.4 <<>> @localhost www.domain.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46688
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;www.domain.com. IN A

;; ANSWER SECTION:
www.domain.com. 14400 IN CNAME domain.com.
domain.com. 14400 IN A xxx.232.66.7

;; AUTHORITY SECTION:
domain.com. 86400 IN NS ns1.host.com.
domain.com. 86400 IN NS ns2.host.com.

;; ADDITIONAL SECTION:
ns2.host.com. 14400 IN A xxx.232.66.7

;; Query time: 177 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Nov 21 16:07:35 2006
;; MSG SIZE rcvd: 138
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
cPanel Access Level
Root Administrator
Did you run this on your DNS servers ? Seems yes, because:

;; ANSWER SECTION:
www.domain.com. 14400 IN CNAME domain.com.
domain.com. 14400 IN A xxx.232.66.7

;; ADDITIONAL SECTION:
ns2.host.com. 14400 IN A xxx.232.66.7

show the identical IP address. So, does NAMED work on the same server ?
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
Yes of course named works otherwise I would not be able to view it with www and both ways in firefox as mentioned.

This is on a dns cluster environment too
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
cPanel Access Level
Root Administrator
Does .htaccess of the account contain some records ? Remove all strange things from the file.
 

Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
The below is for vbseo purpose on this domain/vbulletin forum

# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule (.*) http://www.domain/$1 [R=301,L]

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums)
#RewriteBase /

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.*)$ $1 [L]

RewriteCond %{REQUEST_FILENAME}index\.php -f
RewriteRule ^(.*)$ $1index.php [L]

RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_FILENAME} !chat
RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]

RewriteRule ^$ vbseo.php?vbseourl=index.php [L]
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]