Forum Discussion
Bciesz_171056
Cirrus
Jun 01, 2017iRule for URI/string manipulation
Hi, I need to perform some complex redirections on a VS due to sharepoint migration. Users are reaching my VS using an URL with a specific variable included, like f.ex.:
I need to extract ...
Stanislas_Piro2
Cumulonimbus
Jun 01, 2017Hi,
you can try with this irule:
when HTTP_REQUEST {
switch -glob -- [string tolower [HTTP::path]] {
"/api.dll" {
set objid [URI::query [HTTP::uri] objid]
HTTP::respond 301 Location "http://www.newsite.com/sharepoint.aspx?q=OBJECT%1A${objid}&v=look"
}
"/api.dll/[0-9][0-9][0-9][0-9]" {
set objid [URI::basename [HTTP::uri]]
HTTP::respond 301 Location "http://www.newsite.com/sharepoint.aspx?q=OBJECT%1A${objid}&v=look"
}
"/api.dll/*" {
set objid [URI::basename [HTTP::uri]]
HTTP::respond 301 Location "http://www.newsite.com/sharepoint.aspc?q=eLearning?v=look"
}
}
}
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
