URL forward

Hello,

Can someone help me with creating an irule?

I want to foward the following.

http://www.example.com/test1

to

http://test1.example.com

Thanks

Best Regards

Patrick

do you want redirection or rewriting?

Redirects, Rewrites and App Transfers via iRules by Colin Walker

it has to be an redirect

e.g.

[root@ve10:Active] config  b virtual bar list
virtual bar {
   snat automap
   destination 172.28.19.252:80
   ip protocol 6
   rules myrule
   profiles {
      http {}
      tcp {}
   }
}
[root@ve10:Active] config  b rule myrule list
rule myrule {
   when HTTP_REQUEST {
  if { [HTTP::host] eq "www.example.com" and [HTTP::uri] eq "/test1" } {
    HTTP::redirect "http://test1.example.com"
  }
}
}

[root@ve10:Active] config  curl -i http://www.example.com/test1
HTTP/1.0 302 Found
Location: http://test1.example.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0

Thank you Nitass! This works for me :slight_smile:

Best Regards

Patrick