Forum Discussion
f5now_28704
Nimbostratus
May 21, 2009redirecting URI and passing extra URI...
ok guys not irules can do this but....
--below is working irule--
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/freetrial/tabid/121/default.aspx?referrer=www.yahoo.com&keywords=&landingpage=dealercenter" } {
HTTP::redirect "/dealerCenter7/presentation/agreement/dealersignup.aspx?referrer=www.yahoo.com&keywords=&landingpage=dealercenter"
}
if { [string tolower [HTTP::uri]] eq "/freetrial/tabid/121/default.aspx?referrer=www.msn.com&keywords=&landingpage=dealercenter" } {
HTTP::redirect "/dealerCenter7/presentation/agreement/dealersignup.aspx?referrer=www.msn.com&keywords=&landingpage=dealercenter"
}
if { [string tolower [HTTP::uri]] eq "/freetrial/tabid/121/default.aspx?referrer=www.google.com&keywords=dealercenter&landingpage=dealercenter" } {
HTTP::redirect "/dealerCenter7/presentation/agreement/dealersignup.aspx?referrer=www.google.com&keywords=&landingpage=dealercenter"
}
Now, I wanted to have something like this...
if { [string tolower [HTTP::uri]] starts_with "/freetrial/tabid/121/default.aspx?" } {
HTTP::redirect "/FreeTrial.aspx"-(add everything after the ? to this URI)-
}
so /freetrial/tabid/121/default.aspx?referrer=www.google.com&keywords=dealercenter&landingpage=dealercenter
would be /freetrial.aspx?referrer=www.google.com&keywords=dealercenter&landingpage=dealercenter
thanks for any help
stuck in a hotel.
- hoolio
Cirrostratus
You can use HTTP::query (Click here) to get the current query string value:if { [string tolower [HTTP::uri]] starts_with "/freetrial/tabid/121/default.aspx?" } { HTTP::redirect "/FreeTrial.aspx?[HTTP::query]" }
- f5now_28704
Nimbostratus
Sweet, the HTTP::query worked 100%. Im currently running thru my irules to see if we can work this with others,
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