I want to rewrite URL to redirect to different port, based on HTTP_URL while preserving rest of URL and query string (if specified).
For example,
http://host/john/page.aspx should be redirected to http://host:1900/page.aspx,
http://host/paul/anotherpage.aspx?query to http://host:1901/anotherpage.aspx?query
and http://host/ringo to http://host:1902/
I've added bunch of rules for every allowed port, but it does not look efficient or manageable.
I'm trying to employ map, (ie john->1900, paul->1901) but cannot figure out how to assemble desired URL.
Any suggestions?
解决方案
It took some fiddling to get it working but looking back at it the solutions is quite simple and elegant.
Let me know if this is what you were looking for.