Of course this can be done. But your configuration will be based on a poor webserver/application configuration. You application should always know the external name of the application (Apache: ServerName or Sharepoint: Alternate Access Mappings, etc.) to avoid rewriting. Also the URIs should be the same, as long as you don't want to hide internal URIs to clients. If this is the case, you should ask the developer to do the masking instead of your BIG-IP.
However, you can achieve this by using the Proxy Pass iRule: https://devcentral.f5.com/codeshare/proxypass-v10-v11
This may be the easiest way for you to configure this.
Or may I misunderstood you and you really only want to redirect?
Greets,
svs