Report this

What is the reason for this report?

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?

Posted on July 26, 2017

Ubuntu 16.04.02 x64

Redirect to www.apollos-dev.com



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

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.

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:

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

… 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.