Forum Discussion
Francois
Nimbostratus
May 20, 2019Replace part of URI
Hi, I am looking for an Irule to replace a part of URI. URL = something/abc/azerty I want to rewrite on server side to : URL = thing.abc/azerty Which command can select the first part of URI b...
Francois
Nimbostratus
May 20, 2019when HTTP_REQUEST {
#log "URL : [HTTP::host]"
#log "URI : [HTTP::path]"
set URIclient [getfield [HTTP::uri] "/" 2]
log "URIclient = $URIclient"
set URIpath [getfield [HTTP::uri] "/" 3]
#log "URIpath = $URIpath"
set URIpathdef [string map -nocase [list /$URIclient ""] [HTTP::uri]]
log "URIpathdef = $URIpathdef"
if { [SSL::verify_result] == 0 }{
#log "Certificat OK"
HTTP::header insert "SSL_CLIENT_CERT" [X509::whole [SSL::cert 0]]
HTTP::header replace Host "thing.$URIclient"
HTTP::uri $URIpathdef
#log "Acces = [HTTP::host][HTTP::uri]"
}
}
when HTTP_REQUEST_SEND {
}
when HTTP_RESPONSE {
log "STATUS : [HTTP::status]"
log "LOCATION : [HTTP::header value "Location"]"
}
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