change http header

Hi

I have one http server and created a Virtual server with the help of iApp, application is working fine with https. but i would like to change the url, please advice present url - https://A.myapp.com want to change as - https://B.myapp.com

Please recommand, which iRule should i use or any other service profile need to create to replace the header.

thank you

Try below irule , you should hve http profile enabled under VS

when HTTP_REQUEST {
     if { [string tolower [HTTP::host]] equals "a.myapp.com" } {
          HTTP::respond 301 Location "https://b.myapp.com[HTTP::uri]"
     }
}

or 

when HTTP_REQUEST {
if { [HTTP::host] equals "A.myapp.com"} {
HTTP::redirect "https://B.myapp.com"
}