Routing challenge

Alright Here is what i have.
Cable internet(1 static ip)>MT(X86 3.7)>managed switch.
Here is what i want to do.
I host my website here at my house(example.com). I only have 1 public ip so i run a masquerade rule, And port 80 is DST-NAT’ed to my webserver.
I have a email server that has a webinterface(mail.example.com:9998) I want the router to take the web request mail.example.com and make it into mail.example.com:9998 transparently. It can be done with a php redirect easy, but i want it to be transparent. So if you go to example.com everything works normal, port 80 is handed to my web server, but if the address is mail.example.com it passes it to the mail servers web interface port(9998).

This is from external to internal as you would guess.

That has to be done at the application layer. You would try and use the web proxy, but then it’s proxing everything coming into your web server and your email server’s web server. It is most efficient if you put in a redirect on your web server; unless your cable modem connection is like most and it’s performance is so unpredictable that it won’t matter.

Yeah, Smartermail supports use of IIS, So i switched over to IIS and set that up with host headers.

Cable internet here (central Florida, USA) is very good. I am a business class customer, speeds are rated at 15M/2M
But its faster all of the time. With about 99.999% uptime.

I don’t know what kind of Http deamon you are running at your web machine. anyway I solved that with Apache mod_proxy

I installed Apache with mod_proxy support at my main http server
then i created a vhost file in /etc/apache2/sites-available/
called example.com

and wrote this in the file

<VirtualHost *>
   ServerName example.com
   ServerAlias *.example.com
   AddDefaultCharset utf-8
    ProxyRequests           Off
    ProxyPreserveHost       On
     ProxyPass / http://192.168.0.102/
     ProxyPassReverse / 192.168.0.102/
</VirtualHost>

192.168.0.102 in this example could be your mail server internal ip

After that I linked that file to /etc/apache2/sites-enabled/example.com
then restart apache and you should be able to connect your mailserver at example.com at port 80