By lameei
My DNS settings are as follows:
$TTL 1800
@ IN SOA NS1.DIGITALOCEAN.COM. hostmaster.[mydomain.com]. (
1412671879 ; last update: 2014-10-07 08:51:19 UTC
3600 ; refresh
900 ; retry
1209600 ; expire
1800 ; ttl
)
IN NS NS1.DIGITALOCEAN.COM.
NS NS2.DIGITALOCEAN.COM.
NS NS3.DIGITALOCEAN.COM.
MX 10 mx.zohomail.com.
MX 20 mx2.zohomail.com.
@ IN A [SERVER-IP-ADDRESS-REMOVED]
www CNAME @
The problem is that the domain without www loads index.html in ( /var/www/index.html) and with www loads (/var/www/mydomain.com/public_html/index.html)
How can I fix this issue?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’m using apache2. And the problem is that the domain with www and without it should open the same index.html which they do not.
It’s probably your server configuration. It sounds like you have a configuration for a server with the name mydomain.com and a server root of /var/www/mydomain.com/public_html/. Apparently /var/www/ is the server root for the default domain, which you are seeing because you don’t have a configuration for www.mydomain.com. You should be able to just add www.mydomain.com as a server name for the mydomain.com configuration.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.