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.

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