Stripe slash, /about/ to /about

Hi guys, how do stripe slash if my static files are build like this

index.html
- about/index.html
- contact/index.html
- other/index.html
root⋅*⋅/home/team/example.com/public
file_server
encode⋅zstd⋅gzip

i want to remove /, for example example.com/about/example.com/about

Ah, you want to strip the slash.

Please check out our docs: Common Caddyfile Patterns — Caddy Documentation

However, note that doing this on index files will break relative links and such.

A better way to go about this is make /about.html in the root of your site instead of /about/index.html. More correct semantically.

1 Like

Yep; and then do something like:

try_files {path}.html {path}

to hide the file extension.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.