Forum Discussion
tidenz_92110
Nimbostratus
Oct 08, 2009switch command questions
Hi Guys,
I am trying to mimic a rule we currently have configured on our web servers.
RewriteCond %{REQUEST_URI} ^/view/.*\.do.*
RewriteCond %{REQUEST_URI} !^/view/secure/.*\.do.*
RewriteCond %{REQUEST_URI} !^/view/en_AU/secure/.*\.do.*
RewriteRule ^/(.*) http://abc.com.au/$1 [R,L]
switch -glob [HTTP::uri] {
"/view/*.do*" {
HTTP::redirect "http://abc.com.au[HTTP::uri]"
}
"/view/secure/*.do.*" {}
"/view/en_AU/secure/*.do.*" {}
}
as far as order of operation goes the first entry matches the 2 below so should i put the most specific first and the least specific last?
If a match is made do the rest of the arguments get parsed?
also it is possible to use the not equals operator when using switch?
- hoolio
Cirrostratus
Only one switch case will be matched. You can add a default case if you want to catch any non-matches:switch $some_string { "case 1" { case 1 action here } "case 2" { case 2 action here } default { default action here } }
- tidenz_92110
Nimbostratus
Thanks hoolio i figured it would work the same as use case statements but i wanted to be sure.
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