Alright the title is a bit complicated.
So what i want to achieve is:
If user goes to ex: http://example.com:8080/path i want it to redirect him to http://sub.