Forum Discussion
JPONNUSAMY_2705
Nimbostratus
Jul 31, 2016iRule to hide Query String from URL
Dear F5 Experts,
I am new to F5, We have requirement that we want hide query string externally for End-user, but internally it should use and send request to webServer. Our F5 Team is not aware ...
Yann_Desmarest
Cirrus
Jul 31, 2016Hi,
The below irule can change URI like
/sites/en_US/about/newsroom/year/month to /sites/en_US/about/newsroom?year=year&month=month
when HTTP_REQUEST {
set path [HTTP::path]
if { $path starts_with "/sites/en_US/about/newsroom/" and [URI::path [HTTP::uri] depth] eq "5" } {
set year [getfield $path "/" 6]
set month [getfield $path "/" 7]
set path [URI::path [HTTP::uri] 1 4]
HTTP::uri "$path?year=$year&month=$month"
}
}
- JPONNUSAMY_2705Aug 01, 2016
Nimbostratus
Dear Friend,
Actually I am looking the iRule for changing the URL from /sites/en_US/about/newsroom?year=year&month=month to /sites/en_US/about/newsroom/year/month (Reverse)
Kindly please share for the same.
- Yann_DesmarestAug 01, 2016
Cirrus
Hi,
Sorry I misunderstood your requirement. Please find below an example of translating the uri the way you want :
when HTTP_REQUEST { set path [HTTP::path] if { $path eq "/sites/en_US/about/newsroom" and [HTTP::uri] contains "year=" and [HTTP::uri contains "month=" ] } { set year [URI::query [HTTP::uri] "year"] set month [URI::query [HTTP::uri] "month"] HTTP::uri "$path/$year/$month" } }
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