Avatar of cnl83
cnl83
Flag for United States of America asked on

404 Error when we don't add www in the address bar

I have a domain name that is pointing to a web host that we don't have much control over. Meaning no ftp access or cpanel type of access.

I notice this mostly in Chrome. Is there a zone record I should add so that it does not matter if you type www or leave it out?
DNSWeb DevelopmentWeb Servers

Avatar of undefined
Last Comment
DrDave242

8/22/2022 - Mon
Jason C. Levine

You should have two A records.  One for www and one that is blank.  That handles www.domain.com and domain.com URLs
Julian Hansen

First

ping the www domain and the non-www domain - do they have the same IP - if no then it is a DNS problem.
If yes then it is server configuration problem.
If your webserver is configured to look for the domain name with the www (rather than say an explicit www or a wildcard) then it will return the 404 because when it sees the domain in the request header without the www prefix it won't be able to to find a virtual host to match it to
DrDave242

You don't have an Active Directory domain with the same name as that public domain, do you?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
cnl83

ASKER
This domain is managed in a cpanel environment and unrelated to AD.

I have an A record "@" that points to the site ip address.
I have a cname record "www" that points to "mydomain.com".

I tried to add a Cname without the www, but it was denied.
Jason C. Levine

Can't do a CNAME without a value.  That's what A records are for.
cnl83

ASKER
So how should the A record look?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Jason C. Levine

Two records.  One has www. and the other is blank.  Both point to the IP address for the site.
cnl83

ASKER
I get name is required. Host record field is required.
cnl83

ASKER
should I try *?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
DrDave242

Try @ rather than *.
Jason C. Levine

You need to talk to your registrar.  Something is not right.
cnl83

ASKER
There is already an @
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
DrDave242

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.