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

Common ReWrite request #159

Open
finanalyst opened this issue Apr 15, 2023 · 1 comment
Open

Common ReWrite request #159

finanalyst opened this issue Apr 15, 2023 · 1 comment

Comments

@finanalyst
Copy link

A common rewrite is to add .html to routes on a website.
Eg. routines/say is mapped to the web page routines/say.html and types/IO#say is mapped to types/IO.html#say

Currently :indexes adds a named file when there is a zero route.

Possibly :extension<html> might add .html if the route does map to an existing file.

@finanalyst
Copy link
Author

Further to the above, Possibly make this more generic using :try-files.
Apache uses a ReWrite conditional/rule. The conditional checks that the route is not a directory or existing file, then carries out a Regex based rewrite.

NGINX and Caddy use try-files. If a route does not match an existing file, then alternatives are tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant