From dbd173b4e45eb327d39402bdca43bafa3b941156 Mon Sep 17 00:00:00 2001 From: djeeg Date: Wed, 7 Feb 2018 12:42:04 +0000 Subject: [PATCH] Docs: regex+replacement hints for URL rewriting --- docs/configuration/entrypoints.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/configuration/entrypoints.md b/docs/configuration/entrypoints.md index 28e5cc049..99d4f0028 100644 --- a/docs/configuration/entrypoints.md +++ b/docs/configuration/entrypoints.md @@ -150,7 +150,11 @@ To redirect an entrypoint rewriting the URL. ``` !!! note - Please note that `regex` and `replacement` do not have to be set in the `redirect` structure if an entrypoint is defined for the redirection (they will not be used in this case). + Please note that `regex` and `replacement` do not have to be set in the `redirect` structure if an `entrypoint` is defined for the redirection (they will not be used in this case). + +Care should be taken when defining replacement expand variables: `$1x` is equivalent to `${1x}`, not `${1}x` (see [Regexp.Expand](https://golang.org/pkg/regexp/#Regexp.Expand)), so use `${1}` syntax. + +Regular expressions and replacements can be tested using online tools such as [Go Playground](https://play.golang.org/p/mWU9p-wk2ru) or the [Regex101](https://regex101.com/r/58sIgx/2). ## TLS