Forum Discussion
gbunting
Nimbostratus
Jun 18, 2013Need help creating iRule to do redirects based on uri
Hi,
I need to create an iRule that will match this url:
http://mywebsite.com/SEC+TEST/{x}/{y}.htm
where {x} and {y} can be anything. This should redirect to:
...
Kevin_Stewart
Employee
Jun 18, 2013Here is just ONE way:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/sec+test/" } {
catch {
set index [lindex [split [findstr [string tolower [HTTP::uri]] "/sec+test/" 10 ".htm"] "/"] 1]
if { $index ne "" } {
HTTP::respond 302 Location "http://myotherwebsite.com/folder1/folder2/KB/redirect.aspx?id=$index"
}
}
}
}
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