How to percent-encode request URL when redirecting?

Just recently, I had a similar requirement myself, so I added the placeholder {extra.http.request.url.query_escaped} to my plugin caddy-extra-placeholders:

Placeholder Description
{extra.http.request.url.query_escaped} The full URL of the HTTP request in query-escaped form, safe for use in query strings.

Hope this helps.

2 Likes