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...
The_Bhattman
Nimbostratus
Feb 08, 2010Hi Lolo,
Looking at the original URI I am going to make some assumption that you basically want to strip out the session number? Also the blabla.xxx is the some kind of file where .xxx is the extension. I am also assuming that the LTM is terminating the SSL Connection.
If that is the case the iRule would look something like the following:
when HTTP_REQUEST {
if { [HTTP::host] eq "hostname")} {
HTTP::redirect "https://[HTTP::host][URI::path [HTTP::uri] 2][URI::basename [HTTP::uri]]"
}
}
To break this down:
HTTP::host will contain the hostname of the URL
[HTTP::uri] = the entire URI "/(S(session number))/blabla/blabla.xxx"
[URI::path [HTTP::uri] 2] = will look at the path depth at 2. This will result in finding /blabla
[URI::basename [HTTP::uri]] = will look for the basename of the path which is "blabla.xxx"
Here is a article that talks about parsing a URI (Click here)
I hope this helps
Bhattman
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