Forum Discussion
DoubleJz
Oct 24, 2023Nimbostratus
iRule or LTM Policy to pre-fix desired www. sites
I have an issue where if I browse to https://abc.com the page will not load ( connection timed out) but https://www.abc.com will load as desired. Therefore, I believe I need to somehow modify the fo...
DoubleJz
Nimbostratus
I like that and thats similar to what I was trying to come up with prior posting on here. Also to be clear, the inner if statement doesn't need an else. It if doesn't match any constraints it will just leave that inner if statement and continue on in the outter if statement, right?
when HTTP_REQUEST {
if { [class match [HTTP::host] equals Datagroup1] } {
if { !([HTTP::host] starts_with "www.") && !([class lookup [HTTP::host] Datagroup1] equals "strict") } {
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}
pool prod_sites
} else {
HTTP::respond 403
}
}
Oct 26, 2023
Yes, this looks alright to me.
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