Forum Discussion
pkhatri_72515
Nimbostratus
Jan 15, 2010need 301 redirect help please.
301 redirect of following. Can you please help me out on a best way to do this in F5? iRule? version 9.3.
http://www.bla.com/home/index.cfm?&LANG=EN&CountryLanguage=EN_GL -------> http:...
hoolio
Cirrostratus
Jan 19, 2010Hi Brandon,
Here is one option which combines the host and path for the string to check in the switch statement:
when HTTP_REQUEST {
switch -glob "[string tolower [HTTP::host]][HTTP::path]" {
"*sample.com/folder1*" {HTTP::redirect "http://site.sample.com/default.aspx"}
"*test.com/*" {HTTP::redirect "https://site.test.com/Pages/home.aspx"}
default {HTTP::redirect "https://www.test.com"}
}
}
Note, that I've tried to make the *test* case more specific to reduce the chance that the string "test" will be found in just the path. If that doesn't work for you, can you provide more examples of what you do/don't want to match for each case?
Aaron
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