rewrite_url
- Property Manager name: Modify Outgoing Request Path
- Behavior version: The
v2024-05-31
rule format supports therewrite_url
behavior v1.3. - Rule format status: GA, stable
- Access: Read/Write
- Allowed in includes: Yes
Modifies the path of incoming requests to forward to the origin. This helps you offload URL-rewriting tasks to the edge to increase the origin server's performance, allows you to redirect links to different targets without changing markup, and hides your original directory structure.
Except for regular expression replacements, this behavior manipulates path expressions that start and end with a /
character.
This behavior's rewrite operations can't override any the base_directory
behavior specifies.
Option | Type | Description | Requires | |
---|---|---|---|---|
behavior | enum | The action to perform on the path. | {"displayType":"enum","options":["REPLACE","REMOVE","REWRITE","PREPEND","REGEX_REPLACE"],"tag":"select"} | |
REPLACE | Specify the | |||
REMOVE | Specify the | |||
REWRITE | Specify the | |||
PREPEND | Specify the | |||
REGEX_REPLACE | Specify the | |||
match | string | When | behavior is either: REMOVE , REPLACE | {"displayType":"string","tag":"input","type":"text"} {"if":{"attribute":"behavior","op":"in","value":["REMOVE","REPLACE"]}} |
match_regex | string | When | behavior is REGEX_REPLACE | {"displayType":"string","tag":"input","type":"text"} {"if":{"attribute":"behavior","op":"eq","value":"REGEX_REPLACE"}} |
target_regex | string (allows variables) | When | behavior is REGEX_REPLACE | {"displayType":"string","tag":"input","type":"text"} {"if":{"attribute":"behavior","op":"eq","value":"REGEX_REPLACE"}} |
target_path | string (allows variables) | When | behavior is REPLACE | {"displayType":"string","tag":"input","type":"text"} {"if":{"attribute":"behavior","op":"eq","value":"REPLACE"}} |
target_pathPrepend | string (allows variables) | When | behavior is PREPEND | {"displayType":"string","tag":"input","type":"text"} {"if":{"attribute":"behavior","op":"eq","value":"PREPEND"}} |
target_url | string (allows variables) | When | behavior is REWRITE | {"displayType":"string","tag":"input","type":"text"} {"if":{"attribute":"behavior","op":"eq","value":"REWRITE"}} |
match_multiple | boolean | When enabled, replaces all potential matches rather than only the first. | behavior is either: REMOVE , REPLACE , REGEX_REPLACE | {"displayType":"boolean","tag":"input","type":"checkbox"} {"if":{"attribute":"behavior","op":"in","value":["REMOVE","REPLACE","REGEX_REPLACE"]}} |
keep_query_string | boolean | When enabled, retains the original path's query parameters. | behavior is not REWRITE | {"displayType":"boolean","tag":"input","type":"checkbox"} {"if":{"attribute":"behavior","op":"neq","value":"REWRITE"}} |
Updated 3 days ago