Bob_10976
Jun 22, 2011Nimbostratus
Converting Regex to iRule
I've been tasked with moving our ISAPI rules from the web server to the LTM iRules. I understand ISAPI use regex, however I'm not familiar with that as I need to be so I was hoping to get some feedback here on converting these rules. I'm trying to understand exactly what this rule is doing. It seems as if it’s simply rewriting the host header to show without the www, cms, or even the test portion of the URI. But that doesn't seem to make a lot of sense since the hostheader would need that info to direct the end user to the correct website in IIS. But I could be looking over the obvious.
when HTTP_REQUEST {
switch "[string tolower [HTTP::host]]" {
"test.sitename.us.com" -
"cms.test.sitename.us.com" {
HTTP::header replace "sitename.us.com"
}
}
}
We are using W2K3 servers, IIS6, and Microsoft's Content Management Server. the cms in the URL is where end users, with proper permissions, go to access the content management interface to update their website, and my LTM is version 10.2.0 HF1.
RewriteCond Host: www\.test\.sitename\.us\.com
RewriteHeader Host: .* sitename\.us\.com
RewriteCond Host: cms\.test\.sitename\.us\.com
RewriteHeader Host: .* sitename\.us\.com
Thanks,
Bob