Forum Discussion
HTTP Host header redirect syntax problem
-
if host contains *columbiafs529.com then redirect to www.columbiamanagement.com/products-performance/futurescholar529plans
-
if host contains columbiamanagement.com AND uri ends with /learningcenter then redirect to /www.columbiamanagementlearningcenter.com
when HTTP_REQUEST { if { [HTTP::host] contains "columbiafs529"} { HTTP::redirect "http://www.columbiamanagement.com/products-performance/futurescholar529plans" } } elseif { ([HTTP::host contains "columbiamanagement") and ([HTTP::uri ends_with "/learningcenter")} {HTTPS::redirect "https://www.columbiamanagementlearningcenter.com"} } }
1 Reply
- Kevin_Stewart
Employee
Try this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "columbiafs529" } { HTTP::redirect "http://www.columbiamanagement.com/products-performance/futurescholar529plans" } elseif { ( [string tolower [HTTP::host]] contains "columbiamanagement" ) and ( [string tolower [HTTP::uri]] ends_with "/learningcenter" ) } { HTTPS::redirect "https://www.columbiamanagementlearningcenter.com" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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