Phil_Agee_69879
Dec 14, 2005Nimbostratus
URL Rewriting
We are just getting started with iRule and are curious about the capability to rewrite URLs.
According to the following link (Joe Pruitt's log):
http://devcentral.f5.com/weblogs/Joe/archive/2005/07/27/1397.aspx
to rewrite a URL without changing the URL that the browser shows in the address bar, we can use something like:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/foo" } {
HTTP::uri "/bar"
}
}
What we are looking for is to rewrite as follows:
http://www.domain.com/MyName
to
http://www.domain.com/CustomerHomePage.aspx?CustomerName=MyName
Would the rulle be something like:
when HTTP_REQUEST {
if( [HTTP]::uri /(/w+)/? {
HTTP::uri "/MyPage.aspx\?Param=$1"
}
}
Thanks Very Much,
Phil