Docs: regex+replacement hints for URL rewriting

This commit is contained in:
djeeg 2018-02-07 12:42:04 +00:00 committed by Traefiker
parent 85cfd87c44
commit dbd173b4e4

View file

@ -150,7 +150,11 @@ To redirect an entrypoint rewriting the URL.
``` ```
!!! note !!! 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 ## TLS