Forum Discussion
Venkat_96085
Nimbostratus
May 08, 2009Redirect Rule...
Hi,
I want to write an iRule for redirection but I am unable to do so. I want to read whole URL for example http://www.xyz.com and then redirect it to http://www.abc.com/index.html.
PLease help!!!
Regards,
Puneet Khanna
3 Replies
- dennypayne
Employee
Hi Puneet,
This should do the trick:when HTTP_REQUEST { if { HTTP::host equals "www.xyz.com" } { HTTP::redirect "http://www.abc.com/index.html" } }
Denny
EDITED to use correct command - Venkat_96085
Nimbostratus
Thanks Denny...
I tried to write given below rule..Will this work???
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
"http://www1.qpb.com" {HTTP::redirect "http://www1.qpb.com/ecom/pages/nm/nmhomepage.jsp"}
"http://www1.qpb.com/doc" {HTTP::redirect "http://www1.qpb.com/ecom/pages/nm/nmhomepage.jsp"}}
}
Puneet - Venkat_96085
Nimbostratus
Hi Denny,
Would you be able to tell how the irule will look when both the host and URI is changing. Sorry i am a newbie and have not worked in coding.
Thanks,
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