Redirect wildcards

A wildcard redirect gives site administrators the ability to specify rules for redirecting multiple pages at once.

A wildcard starts with a : and is followed by an alias, such as /products/:productid. Splats are a special type of wildcard defined by ending a source url with /*. The asterisk indicates the splat will match whatever follows after.

Take /products/* for example. It matches /products/electronics/radio, /products/radio, and /products itself. The part of the path that the splat matched is named :splat in the target, so a target of /inventory/:splat results in /inventory/electronics/radio. One splat redirect covers a whole section of a site, including the section's own landing page.

  • A wildcard represents an entire path segment that could be any value
    • /products/:productid would not match /products/electronics/radio because the wildcard :productid can only match a single path segment
  • A splat matches any number of path segments, including none at all
    • /products/* matches /products/electronics/radio and also /products on its own, so a single redirect covers the whole section
    • When the splat matches nothing, it contributes nothing to the target: /products/* -> /inventory/:splat sends /products to /inventory
  • Only a * at the end of a source url is a splat
    • In /products/*/archive, the * is a literal path segment, not a splat
  • A wildcard must start at the beginning of a path segment
    • This is valid: /products/:productid
    • This is invalid: /products/prefix:productid
  • To pass the wildcard information along to the target, it must have a matching wildcard
    • This is valid: /products/:productid -> /inventory/:productid
    • This is invalid: /products/:productid -> /inventory/:product because the wildcard names don't match
    • A splat is named :splat in the target: /products/* -> /inventory/:splat
  • A target with no wildcard sends everything the source matched to the same place
    • /products/* -> /catalog sends /products/radio and /products/electronics/radio both to /catalog

If you configure a project map node to be dynamic, the path segment is considered a wildcard for redirects. This means it must follow the same rules listed above when using a project map node as a source or target.