Forum Discussion
muzammil_88686
Nimbostratus
Sep 28, 2012Redirection of URLs
I m trying to redirect the below URLs.
1)
From: http://www.mysite.com/abc/def/ghi/jkl/fiber/?lang=en&resetP=true
To: http://www.mysite.com/abc/def/ghi/jkl/broad/?lang=en&resetP=true
2)
From: http://www.mysite.com/abc/def/ghi/jkl/fiber/!ut
To: http://www.mysite.com/abc/def/ghi/jkl/broad
I also have the below friendly URL redirection.
===
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www.mysite.com" -
"mysite.com" -
"10.1.1.1" {
switch -glob [HTTP::path] {
"/123" -
"*/abc/def/123" { HTTP::redirect "http://www.mysite.com/abc/def/personal/123/?resetP=true" }
}
}
}
}
===
Could you pls tell me if I can accomodate the redirection of two new URLs into the above friendly URL iRule?
Could you pls suggest me the iRule either in accomodating in above iRule or new iRule.
- Michael_Yates
Nimbostratus
Bad Post.
- Michael_Yates
Nimbostratus
Hi muzammil,when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "www.mysite.com" - "mysite.com" - "10.1.1.1" { switch -glob [string tolower [HTTP::path]] { "/123" - "*/abc/def/123" { HTTP::redirect "http://www.mysite.com/abc/def/personal/123/?resetP=true" } "*/fiber/" { HTTP::redirect "http://[HTTP::host][string map {"/fiber" "/broad"} [HTTP::uri]]" } "*/fiber/!ut" { HTTP::redirect "http://[HTTP::host][string map {"/fiber/!ut" "/broad"} [HTTP::uri]]" } } } } }
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