Forum Discussion
Annsar_Akhtar
Nimbostratus
Sep 21, 2012Irules redirect/rewrite query
Hi all
I am new to the irules forum, and have been looking for the best way to handle a request come from our development team.
The request is as following, currently users browse to http:/...
Kevin_Stewart
Employee
Sep 21, 2012Not 100% clear on your requirements here, but guessing you need to redirect users from www.test.com to www.test2.com IF the end of the URL contains "/xyz"? If so:
when HTTP_REQUEST {
if { ( [string tolower [HTTP::host]] equals "www.test.com" ) and ( [string tolower [HTTP::uri]] ends_with "/xyz" ) } {
HTTP::redirect "http://www.test2.com[HTTP::uri]"
}
}
The URI is left intact, so we're just changing the host value in the redirect. Is this what you're looking for?
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
