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 05, 2013You're going to have to have 200 lines somewhere, but probably better to do it in a data group. So if I understand you, the new hostname is dependent on the requested parent directory, correct? If so, how about 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 ( [class match [string tolower [HTTP::uri]] starts_with my_datagroup] ) } {
HTTP::redirect "http://[class match -value [string tolower [HTTP::uri]] starts_with my_datagroup][HTTP::uri]"
}
}
I've also made a giant assumption here that the hostname is the same for all of the old stuff. If not, your data group key might actually be the old hostname and the parent directory.
Example:
"hostname.com/parentdirectory1/" := "newhostname1.com"
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