Question

How to redirect 301 on the Digital Ocean Apps platform

How are 301 redirects made for websites on the DO App platform?

I would like to redirect certain pages such as:

domain.com/my-old-page/ redirects to domain.com/my-new-page/

I should mention that the content is being generated with Hugo static site generator.

Thank you for your time.

Subscribe
Share

Submit an 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.

This comment has been deleted

We don’t currently offer the ability to configure arbitrary redirects, though it is functionality we are considering.

You could run nginx as a service within your application using a Dockerfile. We have an example nginx Dockerfile and configuration available in our sample repos at https://github.com/digitalocean/sample-nginx. To avoid unnecessary load, I recommend keeping your existing routes for the huge application, and add new routes to nginx just for the parts you want to proxy.

There is another similar discussion related to routes & redirects that you may want to read over as well:

https://www.digitalocean.com/community/questions/how-should-i-implement-proxying-and-redirects-on-the-app-platform

Let me know if you have any further questions!