Forum Discussion
F5-KHAN
Nimbostratus
Jun 27, 2019irule to remove part of uri and combine uri
Hi All, I am looking for irule to achieve below result. 1. stg.gr.com/content/ga/en/page.html --- content uri should be removed and ga/en should merged in form of /en-ga/ to be 301 redi...
Lee_Sutcliffe
Nacreous
Jun 27, 2019Try this
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/content"} {
set field2 [getfield [HTTP::uri] / 3]
set field3 [getfield [HTTP::uri] / 4]
set mergedFields ${field3}-${field2}
set removeContent [string map [list "/content" ""][HTTP::uri]]
set newUri [string map [list "${field2}/${field3}" $mergedFields][HTTP::uri]]
HTTP::redirect https://[HTTP::host]$newUri
}
}
- F5-KHANJul 31, 2019
Nimbostratus
This gives error for line no.6
- Stanislas_Piro2Jul 31, 2019
Cumulonimbus
Add a space just before [HTTP::uri]
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