If someone goes to port 80 of my droplet, I would like them to be redirected to my business website. How can I set that up?

July 26, 2017 1k views
Networking Ubuntu 16.04

Ubuntu 16.04.02 x64

Redirect to www.apollos-dev.com

2 Answers
dwowitz July 27, 2017
Accepted Answer

Redirex looks like it will do what you need in place of a full web server. I haven’t tried it myself, but it looks in line with your needs.

Also, a 301 redirect would be a better choice. Meta redirects are slower, break the web browsers ‘back’ button and can have negative SEO implications.

  • Thanks for the info. I set up lighttpd to do a 301 redirect.

    For anyone that is interested, I added the following lines to the end of /etc/lighttpd/lighttpd.conf

    $HTTP["host"] == "thishost.mydomain.com" {
      url.redirect  = (
        "^/(.*)" => "http://www.mydomain.com/$1",
    $HTTP["host"] == "this.ip.address" {
      url.redirect  = (
        "^/(.*)" => "http://www.mydomain.com/$1",

I answered my own question.

I installed lighttpd, opened port 80 in the firewall, edited /var/www/html/index.lighttpd.html so that it contained the following:

<meta http-equiv="refresh" content="0; URL='http://mydomain.com'" />

… and I’m good to go. If there is another way of doing it without using the minimal resources that lighttpd uses, please let me know.

Have another answer? Share your knowledge.