Forum Discussion
ucgwebmaster_95
Nimbostratus
Dec 01, 2008Multiple Redirects
I have several Host Headers setup in IIS for one website:
ex: nnn.sitename.com
I need to write a rule for www.nnn.sitename.com to redirect to nnn.sitename.com
...
Nicolas_Menant
Employee
Dec 01, 2008if it is always the same format like www.[host] need to be redirected to [host] then a simple iRule that extract the first part should do the job
But if it is not so consistent, you can build a datagroup which says for each host what should be the redirect
ex:
this class definition is what you see in your bigip.conf file when you define a datagroup
class hostredirects {
"www.nnn.sitename.com http://nnn.sitename.com"
"www.nan.sitename.com http://someotherhost.nowhere.com"
}
when HTTP_REQUEST {
set location [findclass [HTTP::uri] $::hostredirects " "]
if { $location ne "" }
HTTP::redirect $location
}
}
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
