If I understand your config correctly it's not possible with only one public IP. You would need two more public static IPs and a router capable of multiple public static IPs.
Some of the Draytek Vigor routers can do that and then you could do port forwarding based on the public IPs.
The only way to accomplish that with just one public IP is to put another apache host in between checking the http get header and routing/forwarding to the right internal IP with a proper virtual host config.
Thank you so much but this seems to be redirecting only the web ports.
How can i redirect all other ports using a domain for connection instead of an IP?
Thanks in advance!
That won't work, you need additional public IPs in that case. ThatÄs a matter of TCP/IP design.
My answer was just because you wrote "redirecting to apache2" above.