Replies: 2 comments 2 replies
-
Basically, a |
Beta Was this translation helpful? Give feedback.
1 reply
-
We fixed by adding this as a
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many static hosts don’t rewrite clean URLs like
/about
to/about/index.html
, so pages generated by the current prerenderer are unreachable unless the URL ends with a trailing slash (e.g.,/about/
).Below are two ways we could make prerendered output work out-of-the-box.
Option 1 (preferred, intuitive): infer from the route string
Let the presence / absence of a trailing slash in each route decide the output shape:
/
build/client/index.html
/about
build/client/about.html
/blog/
build/client/blog/index.html
This requires no extra config and matches what developers already type.
The open question is whether changing the default like this could break existing projects; if that impact is too wide, see Option 2.
Option 2 (explicit flag): keep current default, add an opt-in
This avoids any breaking change but does add one more option to learn.
I’d be grateful if the maintainers could consider which approach fits best—thank you for taking the time to review this proposal!
Original Q&A Post
Click to expand
I’d be grateful if the maintainers could consider which approach fits best—thank you for taking the time to review this proposal!
I’m currently experimenting with pre-rendering.
When I specify paths like ["/", "/about", "/contact"], the files are generated as follows:
However, when hosting these files, it’s often not possible to access the pages using URLs like:
Instead, they are only accessible with trailing slashes:
Would it be possible to configure the output files to remove trailing slashes so they can be accessed without them?
For example:
Beta Was this translation helpful? Give feedback.
All reactions