0

I setup an Apache static website on a DigitalOcean droplet.

The company that hosts my domain name (webhostingpad) provides an "Advanced DNS Zone Editor" which I used to setup a (redirect/forward?) to my droplet.

My domain name is "icecoldnugrape.com".

In the "Zone File Records" section, with TTL=7200, Class=IN, and Type=A, I pointed "icecoldnugrape.com." to the IP address of my droplet. I did this a few months ago.

When I visit my domain name in the url I get forwarded correctly to what my droplet's Apache server is serving, but the IP address of the droplet has taken over the browser's URL bar, rather than my domain name.

How do I keep my domain-name in the url bar of the browser?

enter image description here

2
  • 1
    Nice question +1 Welcome to the site. Cheers!
    – Citizen
    Jun 3 '16 at 3:53
  • Sending GET for http://icecoldnugrape.com or http://www.(same) to your host (which does resolve to 107.170.41.208) returns a 302 redirect (which any normal browser follows) to http://107.170.41.208/jrrecordings from a server that identifies as Apache/2.4.10 (Ubuntu). That sounds like your server. Check your redirect and/or rewrite with [R] rules. Jun 3 '16 at 7:46
2

It turned out (seems obvious now) that in my index.php which is the entry point for incoming requests to my Apache server I was doing:

<?php header('Location: http://107.170.41.208/jrrecordings/'); ?>

When I should have had:

<?php header('Location: http://icecoldnugrape.com/jrrecordings/'); ?>

So, my DNS settings were not the issue, and this was just user error.

1

set an 'A Record' for your WWW entry

Once you have that complete use a CNAME for your domain name entry rather than binding the CNAME to an IP, bind it to a name.

1
  • I changed the "www" entry to: www.icecoldnugrape.com. 7200 IN A 107.170.41.208, but kind of struggling with the second task to do. After work will google up on differences between "CNAME" and "A Record" Jun 3 '16 at 11:44
1

The first thing you will want to do is make sure you set the name servers within your domain's host settings to:

NS1.DIGITALOCEAN.COM

NS2.DIGITALOCEAN.COM

NS3.DIGITALOCEAN.COM

Also make sure you add the domain to your Digital Ocean's droplet by logging in choosing your droplet and hitting Networking at top, you will see a section that says domains where you can add domain. Here is how I set mine up:

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.