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)

0
passing
0
failing
0
total
Akamai signing key: not set Signed tokens default to 2-week (14 day) expiry.
#StatusInbound URLResult (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).

  1. 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.
  2. VOD MPD (line 2318): matches */VOD/* and ext .mpd. Strips T + flags, rewrites /Content//VODMPD/. Sets origin to Otter.
  3. HLS no-sub (line 2425): matches */VOD/* AND master.m3u8 AND NOT */sub/*. Strips T + flags, rewrites to /VODHLS/. Sets origin to Otter.
  4. sub-strip (line 2521): matches */sub/*. Strips first /sub/. Overwritten by T-stamped rules when T is present.
  5. T-MPD / T-HLS (Otter): inside */T??????????/* parent (which extracts PMUSER_EPOCH_TIME and sets cache key). Gated on NOT /sub/. Strips T + flags, hard-codes /VODMPD/ or /VODHLS/.
  6. 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.