Page 1 of 1

Can't access website without WWW

Posted: Thu May 15, 2014 6:57 am
by jimmy
I am not sure if this is the right place to ask this question
I installed VestaCP on a VPS by Digital Ocean
I tried to add a website (Example.com) using the VestaCP - configured the nameservers as follow:

Code: Select all

Name Server: NS1.DIGITALOCEAN.COM
Name Server: NS2.DIGITALOCEAN.COM
Name Server: NS3.DIGITALOCEAN.COM
I can access Example.com but I cannot access http://www.Example.com
I tried to use .htaccess

Code: Select all

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.Example.com [NC]
RewriteRule ^(.*)$ http://Example.com/$1 [L,R=301]
but it did not work

can someone please help?
thanks

Re: Can't access website without WWW

Posted: Thu May 15, 2014 7:38 pm
by SCelik
Do you have an A record or CNAME record for www on digital ocean dns?

Re: Can't access website without WWW

Posted: Fri May 16, 2014 12:35 am
by jimmy
SCelik wrote:Do you have an A record or CNAME record for www on digital ocean dns?
so add a CNAME record for the same domain? (under add records?)
I used to be on a shared hosting and all I did was changing the name servers on the domain provider and used .htaccess file to redirect domains

Re: Can't access website without WWW

Posted: Fri May 16, 2014 4:25 pm
by ivanh
create a cname entry: www and set the value to yourdomain.tld