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

Make URL separator configurable #1919

Closed
johh opened this issue Apr 11, 2022 · 2 comments
Closed

Make URL separator configurable #1919

johh opened this issue Apr 11, 2022 · 2 comments
Labels
enhancement Improved functionality

Comments

@johh
Copy link

johh commented Apr 11, 2022

Search Terms

URL, link, file name, separator, dot

Problem

Some hosting services (Cloudflare Pages in particular) seem to have a problem with HTML files containing dots other than the file extension in the file name.
CF apparently treats any URL containing a dot as a specific file. This collides with their URL rewriting, which causes URLs ending in .html to be redirected to their extensionless version. Normally this works, but if theres a dot still remaining in the URL, CF will proceed to 404, since it can't find that file.

The request
/classes/mymodule.MyClass.html
is redirected to
/classes/mymodule.MyClass
which 404s since the file mymodule.MyClass does not exist.

Suggested Solution

While this is quite obviously a misconfiguration on CFs part, being able to specify a separator manually would mitigate this.
Afaik, this isn't trivially solvable with a plugin, since getUrl on the default theme is a static method. Please correct me if I'm wrong.

Maybe I'm missing a really obvious way to work around this – your help would be much appreciated!

@johh johh added the enhancement Improved functionality label Apr 11, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 11, 2022

Wow, yeah that's annoying... this could be done by a plugin today by providing a custom theme that just overrode the buildUrls method, but that's still not ideal. I've wanted to refactor that part of the code to delegate to a separate router that could be configured independently from the theme for a while. This might be the necessary push for it to actually happen...

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 7, 2023

Closing in favor of #2111.

@Gerrit0 Gerrit0 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants