On my identical test installation, both www and no-www take users to my home page. But on my exact duplicate installation, only the no-www address takes users to the front page. The address with the www gives a "Cannot find server" page message in Firefox and IE.

- I looked at the .htaccess file, but everything was commented
- I uncommented and changed the settings to make www address point to no-www address, but it has no effect
- I checked the settings.php file and ensured that the home page is listed as www.blahblah.com
- FWIW, I cannot log in with the ftp address ftp.blahblah.com -- instead I have to use blahblah.com -- is this related to the other problem?

Is there a setting that I need to change on my cPanel to make my site open to both www and no-www?

Comments

Cybergarou’s picture

The DNS you are using likely only came with an entry pointing example.com to your address. You will also have to add an entry that points www.example.com to your address. Otherwise the DNS lookup won't return your page. You must also do the same thing for ftp.example.com.

thumperstrauss’s picture

Where do I check the DNS entries? At my domain registrar? In cPanel? In the .htaccess file?

grendzy’s picture

That depends on who provides your DNS. It could be your registrar, or your hosting provider. One way to check is to do a whois lookup on your domain here:
http://www.internic.net/whois.html

It will give you a list of nameservers. If the names similar to the name of your hosting company, then you probably need to use cPanel. Otherwise look to your registrar (sometimes it's hard to tell, for example godaddy.com servers use names like park3.secureserver.net

---
Can you help a drupal beginner fix his pet bug in img_assist?

thumperstrauss’s picture

So, I ran the test at DNSreports on the web address that works perfectly and the one that does not. There are two failures in the one that does not work:

FAIL Missing (stealth) nameservers FAIL: You have one or more missing (stealth) nameservers. The following nameserver(s) are listed (at your nameservers) as nameservers for your domain, but are not listed at the parent nameservers (therefore, they may or may not get used, depending on whether your DNS servers return them in the authority section for other requests, per RFC2181 5.4.1). You need to make sure that these stealth nameservers are working; if they are not responding, you may have serious problems! The DNS Report will not query these servers, so you need to be very careful that they are working properly.

ns2.originalhostnamethatIenteredweeksago.net.
ns1.originalhostnamethatIenteredweeksago.net.
This is listed as an ERROR because there are some cases where nasty problems can occur (if the TTLs vary from the NS records at the root servers and the NS records point to your own domain, for example).

FAIL Missing nameservers 2 ERROR: One or more of the nameservers listed at the parent servers are not listed as NS records at your nameservers. The problem NS records are:
ns3.mynewwebhostthatIenteredlastweek.net.
ns2.mynewwebhostthatIenteredlastweek.net.
ns1.mynewwebhostthatIenteredlastweek.net.

This is how these are supposed to look:

PASS Missing (stealth) nameservers OK. All 3 of your nameservers (as reported by your nameservers) are also listed at the parent servers.
PASS Missing nameservers 2 OK. All of the nameservers listed at the parent nameservers are also listed as NS records at your nameservers.

I just discovered the Edit DNS Zone function in my WebHost Manager. I compared the two domains and noticed a few discrepensies. The problematic domain only had one reference to my web host. I entered two more:

mydomain.net.
86400
NS
ns2.mynewwebhostthatIenteredlastweek.net.

mydomain.net.
86400
NS
ns3.mynewwebhostthatIenteredlastweek.net.

I hope that helps. Also, I noticed that the Serial Number value is different for each domain. Is that normal?

grendzy’s picture

Adding those two NS records is a good thing, but it may not solve your problem. Using the "Edit DNS Zone" function that you found, try to add www.mydomain.com as a "CNAME" for mydomain.com. Also realize it could take a day or so for the change to propagate to you. You can check the results immediately by running the shell command "dig +trace www.mydomain.com" (most recent linux distros include this program).

---
Can you help a drupal beginner fix his pet bug in img_assist?

thumperstrauss’s picture

I added www.mydomain.com as a CNAME for mydomain.com. Will report back if that makes a difference. However, FWIW, there was the value www as a CNAME for mydomain.com. already.

thumperstrauss’s picture

You, my friend, are a human genius! I did what you said and it worked -- instantly! Both the www and the no-www versions of my site work! Thanks for your help! Very much appreciated.

- TS

thumperstrauss’s picture

Weird... after several hours, the site is not loading again, in either www or no-www. Will report back if I discover why...

thumperstrauss’s picture

Back up again. Weird.

grendzy’s picture

Yes, sounds like a DNS problem. I also like this site for troubleshooting DNS:
http://dnsreport.com

---
Can you help a drupal beginner fix his pet bug in img_assist?

Abilnet’s picture

For me it looks that you don't have both domain.com and www.domain.com configured in your Apache configuration...

If you have a root access, take a look at file:
/usr/local/apache/conf/httpd.conf

Before editing, please make a backup of the file... then, open the file by using your preferred editor (Pico, Nano, etc) and do a search to find the domain name in question.

Take a closer look at the ServerName and ServerAlias entries for your domain and verify that you have both with "www" and without "www" configured, it looks something like this:

....
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/domain/public_html
....

Save the changes, reboot Apache and you're ready to go - I hope

If you don't have root -access, ask your hosting provider to take a look...