Forum Discussion
kraigk_52257
Nimbostratus
May 02, 2014Moving IIS hosting.asp redirects to iRules
Need help moving IIS redirects to iRule. We have a long list of CNAME DNS records pointing to one IIS web server where we have a "hosting.asp" that does redirection. Some redirects are for sites an...
Lee_Payne_53457
Cirrostratus
May 02, 2014Depending on how many redirects there are you could use either a case select or a datagroup.
With the datagroup, create one with a name of the site and the value as the URi you want to redirect to then use an iRule similar to below.
when HTTP_REQUEST { HTTP::redirect [class lookup [HTTP::host] datagroup1] }
If you only have a couple to do you may want to use a case select switch statement.
switch [URI::query [HTTP::host]] {
option1 { set selected_node uri1 }
option2 { set selected_node uri2 }
}
HTTP::redirect selected_node
or of course you could have the redirect in the switch statement, it depends if you want to use the URI later on for logging etc.. or to make it easier to read.
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