apache, non-standard ports, and ssl woes

I have a Web app running on apache. When I run apache on 80 and 443 it's fine. Within the application, depending on the directory it redirects to http or https as needed.

views OK:
http://something.com/app

go to http://something.com/app/secure redirects to https:/something.com/app/secure

Great, but...

Now I'm trying to run this apache instance on non-standard ports (e.g. 8080 and 8443). I can view the app, but whenever it tries to redirect it doesn't change the port number.

views OK:
http://something.com:8080/app

go to http://something.com:8080/app/secure redirects to https:/something.com:8080/app/secure
which obviously won't work, but if I go directly to https:/something.com:8443/app/secure it loads fine.

I could change the app so that it puts the port numbers in, but what I'm really trying to do is use a second apache instance running on 80 and 443 as a proxy.

I want people to go to http://something.com/app which is a reverse proxy for http://something.com:8080/app and that https://something.com/app is a reverse proxy for https://something.com:8443/app.

The problem with the above is that when someone goes to http://something.com/app/secure it redirects to https:/something.com:8080/app/secure.

I thought about using a rewriterule, but I'm not sure if that can even work. Any advice?

Thanks,
Ian