You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`destination`| Where should the component redirect to |`/`|
19
+
|`statuscode`| What HTTP status code should be used when redirecting |`302`|
20
+
|`include_path`| Whether to include the original request path on the destination redirect; see [wildcard redirects](#wildcard-redirects)|`false`|
21
+
|`trim_prefix`| A specific prefix portion of the original request path to trim (when `include_path` is `true`) ||
20
22
21
23
The `spin-redirect` component tries to look up the config value in the Spin component configuration using the keys shown in the table above (lower case). If desired key is not present, it transforms the key to upper case (e.g., `DESTINATION`) and checks environment variables.
22
24
@@ -73,3 +75,47 @@ statuscode="301"
73
75
route = "/"
74
76
75
77
```
78
+
79
+
### Wildcard redirects
80
+
81
+
Wildcard redirects can be enabled by setting `include_path` to `true`. In the example below,
82
+
all requests to the application will be redirected to `/foo`, with the original request path included,
83
+
e.g. `/bar` will redirect to `/foo/bar`, `/baz` will redirect to `/foo/baz` and so on.
0 commit comments