Forum Discussion
yuanqiang_22112
Nimbostratus
Nov 06, 2016only host equal http://mail.xin.com or http://mail.youxinpai.com to redirect
When client noly hit " http://mail.xin.com "or" http://mail.youxinpai.com " ,F5 redirect https://mail.xin.com/owa ,others reject or drop; I create a irule ,but it not work ,please help me check this .
1 Reply
- VernonWells
Employee
The Request Target path will never match the empty string. There is always a leading slash (/), even if it is implicit. You can also revise your rule somewhat to reduce the number of expansions and repeat branches:
when HTTP_REQUEST { if { [HTTP::path] eq "/" } { switch [string tolower [HTTP::host]] { "mail.xin.com" - "mail.youxinpai.com" { HTTP::respond 301 Location "https://mail.xin.com/owa" return } } } reject }See the following recipe for an explanation on the use of
vs.HTTP::path
and theHTTP::uri
vs.HTTP::respond 301
:HTTP::redirect
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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