Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect: Clean file URLs as well #11220

Open
LecrisUT opened this issue Mar 14, 2024 · 3 comments
Open

redirect: Clean file URLs as well #11220

LecrisUT opened this issue Mar 14, 2024 · 3 comments
Labels
Needed: design decision A core team decision is required

Comments

@LecrisUT
Copy link

LecrisUT commented Mar 14, 2024

What's the problem this feature will solve?

Currently the clean URL redirects /path/to/my_page/ to /path/to/my_page.html, but it doesn't do that for /path/to/my_page.

Describe the solution you'd like

It would be good to have an equivalent that can to that redirect for the file paths as well (those that do not have any suffix).

Alternative solutions

Tried to write a redirect manually for /* to /:splat.html, but that did not work, not to mention that it would fail for properly suffixed files.

Probably this is an issue that can/should be solved upstream, but I am not sure what solution to suggest to them.

npx serve seems to serve the static files just fine. Would there be any method to mimic that?

@humitos
Copy link
Member

humitos commented Mar 18, 2024

Probably this is an issue that can/should be solved upstream, but I am not sure what solution to suggest to them.

What do to mean by upstream here? Whom are them?

npx serve seems to serve the static files just fine. Would there be any method to mimic that?

I'm not sure to follow this. How is npx serve related to this issue here?

@humitos
Copy link
Member

humitos commented Mar 18, 2024

Currently the clean URL redirects /path/to/my_page/ to /path/to/my_page.html, but it doesn't do that for /path/to/my_page.

If I understand correctly, the redirect doesn't work when there is no a trailing slash, right?

@LecrisUT
Copy link
Author

LecrisUT commented Mar 18, 2024

If I understand correctly, the redirect doesn't work when there is no a trailing slash, right?

Yes, that sums it up

What do to mean by upstream here? Whom are them?
I'm not sure to follow this. How is npx serve related to this issue here?

mystmd is the upstream site-generator. Basically is it an issue for the site-generator and/or site hosting? It seems that npx serve does this kind of redirection automatically, that's why I mention it here. But it could be an issue on how the pages are produced, since I don't think sphinx has a similar issue if you open the index.html file manually.

Still, this could be solved on the RTD side as a temporary fix?

Upstream issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

3 participants