caddy-website/src/docs/markdown/caddyfile/directives/uri_replace.md
2020-01-24 12:47:52 -07:00

515 B

title
uri_replace (Caddyfile directive)

uri_replace

Performs a substring or regular expression replacement in the request URI.

Syntax

uri_replace [<matcher>] <find> <replace> [<limit>]
  • <find> is the substring or regular expression to search for.
  • <replace> is the replacement value.
  • <limit> is an optional limit to the number of replacements.

Examples

Replace "/docs/" with "/v1/docs/" in any request URI:

uri_replace * /docs/ /v1/docs/