| Version: v2023-09-20 | Includes use: Yes | 
|---|
Behavior name: Modify Outgoing Request Path
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.
Note: This behavior's rewrite operations can't override any of the
base_directorybehavior's settings.
Default behavior
These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.
data "akamai_property_rules_builder" "rewrite_url" {
  rules_v2023_09_20 {
    name     = "Modify Outgoing Request Path"
    comments = "Modifies the path of incoming requests to forward to the origin."
    behavior {
      rewrite_url {
        behavior          = "REPLACE"
        match             = ""
        target_path       = ""
        match_multiple    = false
        keep_query_string = true
      }
    }
  }
}
"behaviors": [
  {
    "name": "rewriteUrl",
    "options": {
      "behavior": "REPLACE",
      "match": "",
      "targetPath": "",
      "matchMultiple": false,
      "keepQueryString": true
    }
  }
]
Options
| Option | Description | 
|---|---|
| behavior | The action to perform on the path. Value is one of:
           
 | 
| match | When  behaviorisREMOVEorREPLACEspecifies the part of the incoming path you'd like to remove or modify. | 
| match_regex | When  behavioris set toREGEX_REPLACEspecifies the Perl-compatible regular expression to replace withtarget_regex. | 
| target_regex | When  behavioris set toREGEX_REPLACEthis replaces whatever thematch_regexfield matches. Value range is$1-$9. | 
| target_path | Replaces whatever the  matchfield matches in the incoming request's path. | 
| target_pathPrepend | Specifies a path to prepend to the incoming request's URL.
         | 
| target_url | Specifies the full path to request from the origin.
         | 
| match_multiple | When enabled, replaces all potential matches rather than only the first.
         | 
| keep_query_string | When enabled, retains the original path's query parameters.
         | 
