Question

enable paths without trailing slash for static sites on app platform

I’m trying to deploy a static site built with parcel.js that has a bunch of subpages with my dist folder looking like this:

📄 index.html
📁 about
   📄 index.html

Now example.com/about/ works but example.com/about (without trailing slash) returns a 404.

Is there any way to make paths without trailing slashes work in static sites since I have to support an existing url structure?

Vercel for example has configuration options for these settings.


Submit an answer


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 In or Sign Up to Answer

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.

Actually this is the default for a static website. So Digital Ocean seems in not static site compliant. Please solve this!

Bobby Iliev
Site Moderator
Site Moderator badge
March 17, 2023

Hey @martin,

I don’t think that this is possible out of the box with static HTML sites unless you are using a library like React for example.

The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel