Forum Discussion
rodrigo_Benzaqu
Nimbostratus
Aug 02, 2007SSL redirection rule with regular expresion
Hi Guys,
I need to create a rule to redirect
/???/morethings to https://???/morethings
Do you think that is possible ?
Thanks
Rodrigo
Aug 02, 2007
Just change the match pattern in the switch statement:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/abcd/*" -
"/efgh/*" -
"/ijkl/*" {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
}
This will match only on the following
http://www.foo.com/efgh/*
http://www.foo.com/ijkl/*
It will not match on
http://www.foo.com/aaaa/abcd/*
http://www.foo.com/abcd
http://www.foo.com/abc
http://www.foo.com/ab
That's because of the second slash in the match strings. Just modify the match statement using wildcards (*) for any sequence of characters/numbers/symbols/etc.
-Joe
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