redirect https virtual server

we have Vip with port 443 and we have pool members with different ports example 9444, 9445,9446

Application VIP URL : https://192.168.5.9/portal/login

now when we accessed the vip with the following https://192.168.5.9/portal/login .. automatically redirect the request to https://192.168.5.9:9444/portal/login … and we don’t want that

Any IRule Suggestion to solve this issue ?

You don’t need any iRule for that, as it is the default behaviour. The client connects to the virtual server using port 443, the F5 will load balance and should translate the destination IP and port to match the selected pool member, reverse the translation when traffic return.

Make sure you have address translation and port translation enabled in the virtual server settings. Also, make sure the traffic from the server is returning back via the F5, so the translation back occur (you could use SNAT to accomplish that).