TSREMAPFROM/TOURLGET(3ts)
π NAME π
TSRemapFrom/ToUrlGet β the TSRemapFromToUrlGet API function, bestie. yes that's the whole name, we're being thorough here π
β¨ SYNOPSIS β¨
okay so this is the part where you just... copy it exactly, no cap:
#include <ts/ts.h>
TSReturnCode TSRemapFromUrlGet(TSHttpTxn txnp, TSMLoc *urlLocp)
TSReturnCode TSRemapToUrlGet(TSHttpTxn txnp, TSMLoc *urlLocp)
like that's it, that's the whole vibe check π¦
πΈ DESCRIPTION πΈ
so these two functions are your besties for transactions where the URL got remapped, and the reason it got remapped is that it matched a line in remap.config. it's giving "I know a guy who knows where your URL went" π
TSRemapFromUrlGet()β hands you the from URL from the matching line inremap.config. the origin story, the before pic, the "who you were" πΈTSRemapToUrlGet()β hands you the to URL from the matching line inremap.config. the glow-up, the after pic, the "who you became" β¨
lowkey important: this info is only available at or after the TS_HTTP_POST_REMAP_HOOK hook. before that? it's not there. don't come for it early, it's not ready yet π
and here's how the return value works, stay with me:
- if the function returns
TS_SUCCESS, then the location of the URL gets dropped into the variable thaturlLocppoints to. that's your prize π - on error, the function returns
TS_ERROR. tragic. we've all been there π
periodt. that's the whole function. iconic behaviour honestly π
π COPYRIGHT π
copyright 2026, dev@trafficserver.apache.org. they made it, they own it, we respect it π«Ά
and that's a wrap, babes! this whole thing is from Apache Traffic Server, version 9.2, dated Feb 12, 2026 β so go forth, grab your URLs, and slay ππΈβ¨π¦ππ
π¦ where this page comes from
- ubuntu noble: trafficserver-dev 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms