base_​directory

Version: v2025-02-18Includes use: Yes

Behavior name: Origin Base Path

Prefix URLs sent to the origin with a base path.

For example, with an origin of example.​comsetting the value to /images sets the origin's base path to example.​com/images. Any request for a my_pics/home.​jpg file resolves on the origin server to example.​com/images/my_pics/home.​jpg.

Notes:

  • Changing the origin's base path also changes the cache key, which makes any existing cached data inaccessible. This causes a spike in traffic to your origin until the cache repopulates with fresh content.
  • You can't override the base path with other behaviors. For example, if in the rewrite​_url behavior you specify target​Path to /gifs/hello.​gif this gets appended to the base path: example.​com/images/gifs/hello.​gif.

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" "base_directgory" {
  rules_v2025_02_18 {
    name     = "Origin Base Path"
    comments = "Prefix URLs sent to the origin with a base path."
    behavior {
      base_directory {
        value = ""
      }
    }
  }
}
"behaviors": [
  {
    "name": "baseDirectory",
    "options": {
      "value": ""
    }
  }
]

Options

Option Description
value
Specifies the base path of content on your origin server. The value needs to begin and end with a slash / character, for example /parent/child/.