Angel_Martinez_
Aug 04, 2011Nimbostratus
iRule vs HttpClass
Hi
Nowadays my customers ask me for many redirection, for example from http to https, from domain.com to www.domain.com... usually easy things...
User wants to force the Host header.
- Via iRule:
rule iRule_Redirect_www.domain.com {
when HTTP_REQUEST {
if { [HTTP::host] ne "www.domain.com" } {
HTTP::redirect "http://www.domain.com"
}
}
- Via Httpclass
May I do something like that ¿?
profile httpclass httpclass_www.domain.com {
defaults from httpclass
pool none
redirect "http://www.domain.com"
hosts regex "![^www.domain.com*]" --> I don't know how to do a Negative RegExp
}
But what is more effective ¿? which one is less painful for the CPU ¿?
Thank you