Forum Discussion
MihirP1208_3846
Feb 25, 2019Nimbostratus
taking value and append to uri while masking?
Hello F5 community:
Is there such a way to create an irule which will take the value before the domain, *.test123.com, append it to ) and pull up the contents without changing the URL in the ...
MihirP1208_3846
Feb 25, 2019Nimbostratus
I was able to get it to work using the following syntax:
when HTTP_REQUEST { Check for a non-null length host header if {[string match {[a-zA-Z]} [HTTP::host]]}{
Use string commands to parse the subdomain
set subdomain [string range [HTTP::host] 0 [expr {[string first . [HTTP::host]] -1}]]
Use the getfield command to parse the subdomain
set subdomain [getfield [HTTP::host] . 1]
Use scan to parse the subdomain
scan [HTTP::host] {%[^.]} subdomain
HTTP::header replace Host "www.test123.com"
HTTP::uri /$subdomain[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