Hello everyone!
I want change only first slash in uri on a some word.
i.e.: http://example.com/test/picture.jpg
And after change URI must be http://example.com/after_change/test/picture.jpg
I've tried to do with iRule:
when HTTP_REQUEST {
log local0. "Incoming URI = [HTTP::uri]"
if { [string tolower [HTTP::uri]] starts_with "/" } {
set uri [string map -nocase {"/" "/after_change/"} [HTTP::uri]]
log local0. "New URI = $uri"
HTTP::uri $uri
}
}
But this iRule change all slashes in URI:
http://example.com/after_change/test/after_change/picture.jpg
Help needed!
Hi Alexander,
to add a fixed subfolder to every URI, you may want to try the syntax below…
when HTTP_REQUEST {
log local0. "Incoming URI = [HTTP::uri]"
HTTP::uri "/after_change$uri"
log local0. "Outgoing URI = [HTTP::uri]"
}
Cheers, Kai