Forum Discussion
Anthony_Fornito
Cirrus
Nov 22, 2017regex HTTP::header replace "Host"
I am trying to create an irule that can use a regex like:
/^([\s\S]?)(domain.com)./g
So if a user types:
domainname.com
abc.domainname.com
abc.domainname.com\xyz
It will still work.
Current irule
when HTTP_REQUEST {
if { [string tolower [HTTP::uri] ] contains "/?node=1" } {
HTTP::header replace "Host" "dev.domainname.com"
HTTP::path "/"
node 192.168.70.57 443
}
}
I have tried to put the irule in line but it keeps giving errors and google is no help at all.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri] ] contains "/?node=1" } {
HTTP::header replace "Host" "/^([\s\S]*?)(domainname).*/g"
HTTP::path "/"
node 192.168.70.57 443
}
}