Akamai rewrite-rule helper
Models the Akamai config: default origin is
vos360, with rules applied in document order.
Each rule reads the original inbound URL (%(AK_URL)) — not the output of prior
rules. When multiple rules fire, the last one's output wins (overwrites). PASS
requires both outgoing path and origin to match.
Rules (document order)
| # | Status | Inbound URL | Result (origin + outgoing path) | Rule trace |
|---|
Ad-hoc test
About this harness / how the model maps to the XML
The rules below mirror the document order in the Akamai config.
Under Model A, each rule reads the original inbound URL
(%(AK_URL)). When multiple rules fire, the last one's output overwrites earlier
ones. Origin overrides persist (the last rule to set origin wins).
- geo-strip / tok-strip / geotok-strip / open-strip (lines 1718–1775): each
matches its respective
*/flag/*and replaces the first/flag/with/. Overwritten by later rules for VOD content, but still useful for non-VOD paths. - VOD MPD (line 2318): matches
*/VOD/*and ext.mpd. Strips T + flags, rewrites/Content/→/VODMPD/. Sets origin to Otter. - HLS no-sub (line 2425): matches
*/VOD/*ANDmaster.m3u8AND NOT*/sub/*. Strips T + flags, rewrites to/VODHLS/. Sets origin to Otter. - sub-strip (line 2521): matches
*/sub/*. Strips first/sub/. Overwritten by T-stamped rules when T is present. - T-MPD / T-HLS (Otter): inside
*/T??????????/*parent (which extractsPMUSER_EPOCH_TIMEand sets cache key). Gated on NOT/sub/. Strips T + flags, hard-codes/VODMPD/or/VODHLS/. - T-MPD / T-HLS (vos360): same parent block. Gated on
/sub/. Strips T + flags +/sub/from original, preserves/Content/prefix via$1.
Each rule's regex and conditions are evaluated against the original inbound URL. If the regex doesn't match, the outcome is the original URL unchanged (but origin overrides still apply). Default origin is vos360.
Akamai evaluates PCRE; this harness uses JS regex. For the patterns in use (no recursion,
no named subroutines, no possessive quantifiers, no \K) the two engines behave
identically.