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

[Feature request] Query placeholder that includes ? #6705

Open
uumas opened this issue Nov 23, 2024 · 1 comment
Open

[Feature request] Query placeholder that includes ? #6705

uumas opened this issue Nov 23, 2024 · 1 comment

Comments

@uumas
Copy link

uumas commented Nov 23, 2024

So basically just the current {query} placeholder but with the leading ? included if the query isn't empty. Maybe called {fullquery} ({http.request.uri.fullquery}) or something like that.

Use case:
I want to redirect domain.tld/path to anotherdomain.tld, preserving query string if present. If I wanted tp preserve path too, I could user {uri} or I could use ?{query} but then then the redirect would be to anotherdomain.tld? if there is no query.

@francislavoie
Copy link
Member

francislavoie commented Nov 23, 2024

Yeah good idea. Maybe {prefixed_query} would do? I think that name would properly explain the behaviour.

PRs welcome, very simple feature. Should add the Caddyfile shortcut and the HTTP placeholder.

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

2 participants