Forum Discussion
Davean_Hosang_1
Nimbostratus
Aug 05, 2013multiple URI redirects
Hello,
I will be migrating a .NET environment with approximately 300 parent web directories. We will need to look at the parent web directory of the application, change the hostname and l...
Kevin_Stewart
Employee
Aug 28, 2013My 9.x coding is a little rusty, but I think it'd go something like this:
Data group (example: "my_datagroup")
"/parentdirectory1/ hostname1"
"/parentdirectory2/ hostname2"
...
"/parentdirectory300/ hostname300"
iRule
when HTTP_REQUEST {
if { ( [string tolower [HTTP::host]] equals "hostname.com" ) and ( [matchclass [string tolower [HTTP::uri]] starts_with my_datagroup] ) } {
set newhost [findclass [string tolower [HTTP::uri]] my_datagroup " "]
HTTP::redirect "http://$newhost[HTTP::uri]"
}
}
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