fix subapps on portmapped URLs

Reviewed by @jcheng5