Hi Digital Ocean Community,
I host a static personal website on Digital Ocean App Platform. I want every request that excludes the .html extension to redirect to the .html page. Currently I have to write each of these rules individually per page, as shown below.
For example: tobkin.us/contact ->302-> tobkin.us/contact.html
Is there any way I can use a wildcard instead to condense this App Specification? Or even better, rewrite all *.html pages to have no extension so there is no redirect?
ingress:
rules:
- component:
name: tobkin-static-html
match:
path:
prefix: /
- match:
path:
prefix: /index
redirect:
redirect_code: 301
uri: /index.html
- match:
path:
prefix: /resume
redirect:
redirect_code: 301
uri: /resume.html
- match:
path:
prefix: /contact
redirect:
redirect_code: 301
uri: /contact.html
- match:
path:
prefix: /office-hours
redirect:
redirect_code: 301
uri: /office-hours.html
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!
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.