Forum Discussion
Angelo
Nimbostratus
May 13, 2013redirect Multiple URL's
Hi
I got a rule to redirect multiple URL's to anothers but i'm not sure if it's going to work..
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www.test.com" { [string tolower [HTTP::uri]] "www.test201.net" }
"www.example.com" { [string tolower [HTTP::uri]] "www.example403.net" }
"www.something.com" { [string tolower [HTTP::uri]] "www.example403.net" }
"www.testing.com" { [string tolower [HTTP::uri]] "www.example403.net" }
default {
reject }
}
}
3 Replies
- What_Lies_Bene1
Cirrostratus
Hey Angelo,
No it's not going to work. Are you looking to redirect or rewrite the URI or modify the HTTP Host header/domain name here? - Angelo
Nimbostratus
it's will have to be a redirect to another site... - What_Lies_Bene1
Cirrostratus
OK, so this should do it whilst preserving the original request URI;when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "www.test.com" { HTTP::redirect "http://www.test201.net[string tolower [HTTP::uri]]" } "www.example.com" { HTTP::redirect "http://www.example403.net[string tolower [HTTP::uri]]" } "www.something.com" { HTTP::redirect "http://www.example403.net[string tolower [HTTP::uri]]" } "www.testing.com" { HTTP::redirect "http://www.example403.net[string tolower [HTTP::uri]]" } default { reject } } }
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