Control Web Panel

WebPanel => DNS => Topic started by: belveder on March 27, 2016, 06:22:47 PM

Title: Domain doesn't work without 'www'
Post by: belveder on March 27, 2016, 06:22:47 PM
Hello,

I have a wiered problem.

Since I moved to CentOS Web Panel, my domain is not working without 'www'. It only works like www.domain.com , but it doesn't open if you type domain.com

Any tips how to solve that through Centos Web Panel?
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 27, 2016, 10:29:51 PM
Redirect non www to www in .htaccess
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 27, 2016, 10:43:55 PM
Can you show me example for that?

I'm using WordPress website and SMF forum...I tried putting in .htaccess something but it didn't quiet work.
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 27, 2016, 10:47:06 PM
Can u pm the domain or u can post here
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 27, 2016, 10:48:51 PM
Sure, it's www.juvebalkan.com
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 27, 2016, 10:55:05 PM
Your domain's dns records are not properly setup. Check your name server and dns records.
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 27, 2016, 10:56:56 PM
If you moved to new server with new ip check the server ip in name server (child name server)
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 27, 2016, 11:05:53 PM
Thank you for your answer.

I'm actually using this server (VPS) from 2012, so it's not a new server.

People can actually access it normally if they type www.juvebalkan.com but they can't if they type only juvebalkan.com

So I was wondering if there is anything I am missing here...
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 27, 2016, 11:09:22 PM
It is name server problem ... Name servers are not correctly configured
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 27, 2016, 11:10:06 PM
Can I configure that through Centos Web Panel, and if yes, how can I do that so it can work and without www. ?

Thanks!
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 27, 2016, 11:13:04 PM
I'll recommend you to use cloudflare dns or cwp free dns services...
Title: Re: Domain doesn't work without 'www'
Post by: Jae on March 28, 2016, 01:19:22 AM
Can I configure that through Centos Web Panel, and if yes, how can I do that so it can work and without www. ?

Thanks!

yes you can, at least you need two line like this

juvebalkan.com     0   IN   A                 84.200.77.148
www                     0   IN   CNAME        juvebalkan.com



Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 09:55:53 AM
Thanks Jae.

I added that and restarted named service.

But I'm not quiet sure if it's working now without www
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 09:58:02 AM
Actually, it doesn't let me add that at all.

I add that, click Save, and when I open it again, it's not there, it's not saved...Edit file or Edit records, both won't save the changes
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 28, 2016, 10:02:39 AM
http://leafdns.com/index.cgi?testid=92C163F4

no records for your domain
Title: Re: Domain doesn't work without 'www'
Post by: Igor S. on March 28, 2016, 10:03:43 AM
Hi, try to edit the file /var/named/juvebalkan.com.db directly and add the record.
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 28, 2016, 10:06:12 AM
Hi, try to edit the file /var/named/juvebalkan.com.db directly and add the record.

I think he messed the bind server
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 10:10:16 AM
I added those lines directly through SSH, but when I tried to restart named service, I got this:

Code: [Select]
[root@capitano ~]# /etc/init.d/named restart
Stopping named: .                                          [  OK  ]
Starting named:
Error in named configuration:
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
dns_master_load: /var/named/www.juvebalkan.com.db:23: www.www.juvebalkan.com: multiple RRs of singleton type
zone www.juvebalkan.com/IN: loading from master file /var/named/www.juvebalkan.com.db failed: multiple RRs of singleton type
zone www.juvebalkan.com/IN: not loaded due to errors.
_default/www.juvebalkan.com/IN: multiple RRs of singleton type

I edited again and removed those lines and it started ok again
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 10:16:14 AM
http://leafdns.com/index.cgi?testid=92C163F4

no records for your domain

So you think my custom nameservers are not properly configured? It's standard GoDaddy feature, I had them before and everything was working ok
Title: Re: Domain doesn't work without 'www'
Post by: Jae on March 28, 2016, 10:31:43 AM

zone www.juvebalkan.com/IN: not loaded due to errors.


seem you wrong entering domain, juvebalkan.com is your domain, but you enter www.juvebalkan.com subdomain as main domain.
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 10:38:04 AM
You are probably right...when I created domain account, I entered www.juvebalkan.com and it automatically created this DNS record.

I don't have anything for juvebalkan.com in the list

What should I do, any solution for that? Maybe create a new DNS record and replicate www.juvebalkan.com entry with juvebalkan.com?
Title: Re: Domain doesn't work without 'www'
Post by: Igor S. on March 28, 2016, 11:28:07 AM
Hello.

Yes, you should create additional domain juvebalkan.com and add to it subdomain www .
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 12:22:05 PM
Can I, for example, create new account/domain juvebalkan.com and in the hosting itself make PHP redirection to www.juvebalkan.com or something

Would that work?
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 28, 2016, 12:25:36 PM
Hello.

Yes, you should create additional domain juvebalkan.com and add to it subdomain www .

Can you, somehow, expand the answer a little bit?

So I should create a new account in CWP, and add domain name juvebalkan.com or should I just create DNS record for juvebalkan.com?

Thanks!
Title: Re: Domain doesn't work without 'www'
Post by: Jae on March 28, 2016, 01:40:22 PM
The best and correct step, backup you web. delete user with www.juvebalkan.com domain, then create user with juvebalkan.com domain and restore all web content.
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 10:17:28 AM
Is there any way to modify the current setting or add some record without moving my data?
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 10:22:08 AM
All I want is to somehow redirect everything from juvebalkan.com to www.juvebalkan.com
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 10:50:04 AM
Is it a good solution to create new account/domain with juvebalkan.com and just input .htaccess there with following lines:

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

Would that work good?
Title: Re: Domain doesn't work without 'www'
Post by: Igor S. on March 29, 2016, 11:35:46 AM
If DNS record for juvebalkan.com does not exists a redirects won't be works.
You have to configure your DNS records for juvebalkan.com and www.juvebalkan.com
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 01:11:30 PM
Can I do that through CWP?

If yes, how?

Thanks.
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 29, 2016, 01:22:28 PM
yes

just add A record and cname record for www
you need to add ns records also

Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 02:06:31 PM
Do I edit existing DNS zone, or create new one, or...?
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 29, 2016, 02:09:58 PM
delete all dns records and create new one :-

A
Cname
MX
NS

A record will be non www and should point to server ip address

eg.
A    domain.com    192.168.0.1
cname    www   domain.com
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 02:14:23 PM
So you are saying following:

- I should delete DNS zone for www.juvebalkan.com

- Create new DNS zone for juvebalkan.com  with the same IP address

And everything will work ok?
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 29, 2016, 02:18:17 PM
yes .... after that create a .htaccess file to redirect non www to www and edit the domain url setting in WordPress admin settings. to www.domain.com
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 02:20:34 PM
Can moderator or administrator confirm this should work?

I already have WordPress redirecting to www. anyway, and htaccess lines also

(because only www.juvebalkan.com works, juvebalkan.com doesn't opet anything, doesn't resolve)
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 29, 2016, 02:22:50 PM
you dns record should be non www to redirect to www ... if your existing record is for www.domain.com then how it will redirect non www. to www
Title: Re: Domain doesn't work without 'www'
Post by: belveder on March 29, 2016, 02:32:26 PM
But what about website files and databases, since they are created to be on www.juvebalkan.com ? Will they remain there and will juvebalkan.com load them properly from they same position on the server as they are now?
Title: Re: Domain doesn't work without 'www'
Post by: Sandeep on March 29, 2016, 02:35:30 PM
 htaccess script will do the trick by redirecting non www to www.

files and databases will be safe.
Title: Re: Domain doesn't work without 'www'
Post by: blakilox on June 15, 2018, 06:40:16 AM
Hi re-direction will of course work though none of these seem to be good solutions it seems by Default CWP will assume your preference is for www.mydomain.com to me www is just completely unnecessary so how would one Configure CWP so that when new user accounts are added the "mydomain.tld" will work to account/public_html/index.html

it seems the extra step of adding the .htaccess redirection is needed every account
Thanks, Garry, Central Australia
Title: Re: Domain doesn't work without 'www'
Post by: sundar rajamani on December 12, 2021, 03:12:53 PM
delete all dns records and create new one :-

A
Cname
MX
NS

A record will be non www and should point to server ip address

eg.
A    domain.com    192.168.0.1
cname    www   domain.com

My domain is s4hosting.in hostname is cwp.s4hosting.in using cloudflare ns records dns records are looking fine http://leafdns.com/index.cgi?testid=196F7599 but still i couldnt renew letsencrypt ssl every time getting www or without ww error can u pls help in this......