Forum Discussion
Lolo_17756
Nimbostratus
Feb 08, 2010iRule Rewrit URI
Hello i' m has newbee in BigIp world.
I need to modify an URI in the following way:
URi Users = https://hostname/(S(session number))/blabla/blabla.xxx
It i...
hoolio
Cirrostratus
Feb 08, 2010Another option for removing the first string between forward slashes is to use scan (Click hereüòû
when HTTP_REQUEST {
Read in everything after the first / that is not a /.
Save that to $session_id and everything else to $uri_to_save
scan [HTTP::uri] {/%[^/]%s} session_id uri_to_save
Rewrite the URI without the session ID
HTTP::uri $uri_to_save
}
Here is an example:
% set uri /my_session_id_string/path/to/preserve?query=string
/my_session_id_string/path/to/preserve?query=string
% scan $uri {/%[^/]%s} session_id uri_to_save
2
% puts $uri_to_save
/path/to/preserve?query=string
% puts $session_id
my_session_id_string
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects