Forum Discussion
djkromarek
Nimbostratus
Jun 24, 2013removing part of uri in redirect
We are moving servers and our paths from site to application are changing. For example, I have a current path of testsite.com/applications/testapp/lowerfolder/lowerfolder/test.aspx?param1=1¶m2=2 ...
djkromarek
Nimbostratus
Jun 24, 2013Below is my iRule, In this particular case, applications is always there, but where I have testapp and beyond that will change. This particular application 'testapp' needs to go to a different pool and have the beginning of the URL change from http://testsite.com/applications/testapp/... to https://testsite.com/testapp/...
The host will always remain the same and in this particular irule, testapp will always remain the same, but what follows after testapp/ will change based on code in the application.
The line HTTP::redirect "https://[HTTP::host][HTTP::uri]" is what I need to change to drop the /application from the URI.
when HTTP_REQUEST {
if { [HTTP::host] contains "testsite.com" } {
if {[string tolower [HTTP::uri]] starts_with "/applications/testapp/" } {
HTTP::redirect "https://[HTTP::host][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