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
This needs to be done for at least 10 URL's.
What would be the best way to tackle this?
Thank you in Advance!!!
3 Replies
Sort By
- Nicolas_Menant
Employee
if 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 jobthis 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 } }
- ucgwebmaster_95
Nimbostratus
I am still learning my way around the BigIp. Where do I define this data group? Also,removing the www sounds like a good option. Can you show me an example? - JRahm
Admin
In the GUI it is a tab in the iRules section at the top of the editing window. In the CLI, it is called a class, and can be defined with the bigpipe class command.
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